From cfd165366900e6719fbb094c2a70eb8c8009a0dd Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Thu, 3 Jul 2008 20:18:07 +0200 Subject: Make LOAD print nicer descriptions of what it's doing. --- MLKInterpreter.m | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/MLKInterpreter.m b/MLKInterpreter.m index 247bc8e..030d537 100644 --- a/MLKInterpreter.m +++ b/MLKInterpreter.m @@ -562,6 +562,7 @@ static MLKSymbol *_LAMBDA; eofValue:eofValue recursive:NO preserveWhitespace:NO]; + NSString *formdesc; //NSLog (@"%@", code); //NSLog (@"%@", [code descriptionForLisp]); @@ -571,7 +572,14 @@ static MLKSymbol *_LAMBDA; if (code == eofValue) break; - NSLog (@"; LOAD: Evaluating a top-level form."); + if ([code isKindOfClass:[MLKCons class]] && [code cdr]) + formdesc = [NSString stringWithFormat:@"(%@ %@ ...)", + [[code car] descriptionForLisp], + [[[code cdr] car] descriptionForLisp]]; + else + formdesc = [code descriptionForLisp]; + + NSLog (@"; LOAD: Evaluating a top-level form: %@.", formdesc); result = [MLKInterpreter eval:code inLexicalContext:[MLKLexicalContext globalContext] @@ -581,7 +589,7 @@ static MLKSymbol *_LAMBDA; if (print) { //FIXME - NSLog (@"; LOAD: Fnord. Primary value: %@", result); + //NSLog (@"; LOAD: Fnord. Primary value: %@", result); } } -- cgit v1.2.3