From 05a7ec11d7f8b5b29929d27ae1ee12c249a2a705 Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Wed, 3 Sep 2008 10:02:53 +0200 Subject: =?UTF-8?q?Make=20the=20terminal-based=20tool=20=E2=80=9Ctoilet?= =?UTF-8?q?=E2=80=9D=20independent=20of=20the=20location=20of=20init.lisp.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MLKReadEvalPrintLoop.m | 15 +++++---------- 1 file 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) -- cgit v1.2.3