summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-06-22 23:58:13 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-06-22 23:58:13 +0200
commit8ee081ba24c1fdbce25f7d8a7f3c452369f25209 (patch)
tree64b308ba1431eeaaf46244c8eccaf581c1b40163
parent90dd81762b1c62246a31245d8bbb27966b1d5452 (diff)
REPL: Don't crash when printing NIL.
-rw-r--r--MLKReadEvalPrintLoop.m7
1 files changed, 5 insertions, 2 deletions
diff --git a/MLKReadEvalPrintLoop.m b/MLKReadEvalPrintLoop.m
index a6eb267..b5710f2 100644
--- a/MLKReadEvalPrintLoop.m
+++ b/MLKReadEvalPrintLoop.m
@@ -92,8 +92,11 @@ static const char *prompt (EditLine *e) {
globalContext]
withEnvironment:[MLKLexicalEnvironment
globalEnvironment]];
-
- printf ("%s\n", [[result descriptionForLisp] UTF8String]);
+
+ if (result)
+ printf ("%s\n", [[result descriptionForLisp] UTF8String]);
+ else
+ printf ("()\n");
}
NS_HANDLER
{