diff options
author | Matthias Benkard <mulk@minimulk.mst-plus> | 2008-09-03 10:02:53 +0200 |
---|---|---|
committer | Matthias Benkard <mulk@minimulk.mst-plus> | 2008-09-03 10:02:53 +0200 |
commit | 05a7ec11d7f8b5b29929d27ae1ee12c249a2a705 (patch) | |
tree | 523e66a41e88abda3c577708c03224c49eba0e20 | |
parent | 07aea7334f5e82002bcbd86edb5cd811be57d441 (diff) |
Make the terminal-based tool “toilet” independent of the location of init.lisp.
-rw-r--r-- | MLKReadEvalPrintLoop.m | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/MLKReadEvalPrintLoop.m b/MLKReadEvalPrintLoop.m index e3700ea..d6e4000 100644 --- a/MLKReadEvalPrintLoop.m +++ b/MLKReadEvalPrintLoop.m @@ -23,6 +23,7 @@ #import "MLKPackage.h" #import "MLKReadEvalPrintLoop.h" #import "MLKReader.h" +#import "MLKRoot.h" #import "MLKStreamStream.h" #import "NSObject-MLKPrinting.h" #import "runtime-compatibility.h" @@ -99,21 +100,15 @@ static const char *prompt (EditLine *e) { pool = [[NSAutoreleasePool alloc] init]; + [MLKRoot registerBuiltins]; printf ("Loading init.lisp.\n"); #if 1 @try { #endif - input = [NSInputStream inputStreamWithFileAtPath:@"init.lisp"]; - filestream = LAUTORELEASE ([[MLKStreamStream alloc] - initWithInputStream:input]); - stream = LAUTORELEASE ([[MLKBinaryStreamCharacterStream alloc] - initWithBinaryStream:filestream]); - - [input open]; - [MLKInterpreter load:stream verbose:YES print:YES]; - success = [MLKInterpreter load:stream verbose:YES print:YES]; - [input close]; + [[[MLKLexicalEnvironment globalEnvironment] + functionForSymbol:[[MLKPackage findPackage:@"TOILET-SYSTEM"] intern:@"REQUIRE"]] + applyToArray:[NSArray arrayWithObject:@"init.lisp"]]; #if 1 } @catch (NSException *localException) |