diff options
author | Matthias Andreas Benkard <matthias@benkard.de> | 2008-08-04 18:18:41 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <matthias@benkard.de> | 2008-08-04 18:18:41 +0200 |
commit | 90e6023292e2bfe927bd633bac42fc355bb9f4d1 (patch) | |
tree | 14664b9e9d98f43c83b78547ea7c554fef8de9d1 /MLKInterpreter.m | |
parent | 383e3e833a7fbb8b1560ba861b76e8be96542c6f (diff) |
Add support for fixnums.
Diffstat (limited to 'MLKInterpreter.m')
-rw-r--r-- | MLKInterpreter.m | 11 |
1 files changed, 10 insertions, 1 deletions
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) { |