summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MLKInterpreter.m18
-rw-r--r--MLKPackage.m2
2 files changed, 20 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])
diff --git a/MLKPackage.m b/MLKPackage.m
index 4060e81..b8370c4 100644
--- a/MLKPackage.m
+++ b/MLKPackage.m
@@ -71,6 +71,8 @@ static NSMutableDictionary *packages = nil;
[cl export:[cl intern:@"SETQ"]];
[cl export:[cl intern:@"DECLARE"]];
[cl export:[cl intern:@"QUOTE"]];
+ [cl export:[cl intern:@"VALUES"]];
+ [cl export:[cl intern:@"EVAL"]];
[sys export:[sys intern:@"%DEFMACRO"]];
[sys export:[sys intern:@"%LAMBDA"]];