summaryrefslogtreecommitdiff
path: root/MLKInterpreter.m
diff options
context:
space:
mode:
Diffstat (limited to 'MLKInterpreter.m')
-rw-r--r--MLKInterpreter.m18
1 files changed, 18 insertions, 0 deletions
diff --git a/MLKInterpreter.m b/MLKInterpreter.m
index 0b50312..49db342 100644
--- a/MLKInterpreter.m
+++ b/MLKInterpreter.m
@@ -68,6 +68,7 @@ static MLKSymbol *EVAL;
static MLKSymbol *QUOTE;
static MLKSymbol *SETQ;
static MLKSymbol *PROGV;
+static MLKSymbol *VALUES;
static MLKSymbol *_DEFMACRO;
static MLKSymbol *_LAMBDA;
@@ -92,6 +93,7 @@ static MLKSymbol *_LAMBDA;
QUOTE = [cl intern:@"QUOTE"];
SETQ = [cl intern:@"SETQ"];
PROGV = [cl intern:@"PROGV"];
+ VALUES = [cl intern:@"VALUES"];
_DEFMACRO = [sys intern:@"%DEFMACRO"];
_LAMBDA = [sys intern:@"%LAMBDA"];
}
@@ -326,6 +328,22 @@ static MLKSymbol *_LAMBDA;
{
//FIXME: ...
}
+ else if (car == VALUES)
+ {
+ id results = [NSMutableArray array];
+ id rest = program;
+
+ while ((rest = [rest cdr]))
+ {
+ [results addObject:
+ [[self eval:[rest car]
+ inLexicalContext:context
+ withEnvironment:lexenv]
+ objectAtIndex:0]];
+ }
+
+ return results;
+ }
else
{
if ([context symbolNamesFunction:car])