From 8ee081ba24c1fdbce25f7d8a7f3c452369f25209 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sun, 22 Jun 2008 23:58:13 +0200 Subject: REPL: Don't crash when printing NIL. --- MLKReadEvalPrintLoop.m | 7 +++++-- 1 file 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 { -- cgit v1.2.3