From 90e6023292e2bfe927bd633bac42fc355bb9f4d1 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Mon, 4 Aug 2008 18:18:41 +0200 Subject: Add support for fixnums. --- MLKInterpreter.m | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'MLKInterpreter.m') diff --git a/MLKInterpreter.m b/MLKInterpreter.m index cfb70a9..ad472b9 100644 --- a/MLKInterpreter.m +++ b/MLKInterpreter.m @@ -178,7 +178,16 @@ static MLKSymbol *MULTIPLE_VALUE_CALL; NSLog (@"; EVAL: %@", MLKPrintToString(program)); #endif // TRACE_EVAL - if (!program || [program isKindOfClass:[MLKSymbol class]]) + if (MLKFixnumP (program)) + { + // Fixnums evaluate to themselves. + // + // We need to get this case out of the way as early as possible, + // as we're going to repeatedly send messages to `program' after + // this point. + RETURN_VALUE (program); + } + else if (!program || [program isKindOfClass:[MLKSymbol class]]) { if (mode == compile_time_too_mode) { -- cgit v1.2.3