summaryrefslogtreecommitdiff
path: root/MLKInterpreter.m
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-07-03 20:18:07 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-07-03 20:18:07 +0200
commitcfd165366900e6719fbb094c2a70eb8c8009a0dd (patch)
tree37e8a62135d602567ebae24c4210f9f726bc2e17 /MLKInterpreter.m
parent475dd63b41774c96289df54c7987de95faa55099 (diff)
Make LOAD print nicer descriptions of what it's doing.
Diffstat (limited to 'MLKInterpreter.m')
-rw-r--r--MLKInterpreter.m12
1 files 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);
}
}