summaryrefslogtreecommitdiff
path: root/MLKInterpreter.m
diff options
context:
space:
mode:
Diffstat (limited to 'MLKInterpreter.m')
-rw-r--r--MLKInterpreter.m14
1 files changed, 14 insertions, 0 deletions
diff --git a/MLKInterpreter.m b/MLKInterpreter.m
index 778985f..37d4523 100644
--- a/MLKInterpreter.m
+++ b/MLKInterpreter.m
@@ -42,6 +42,7 @@
static MLKPackage *cl;
static MLKPackage *sys;
static MLKSymbol *IF;
+static MLKSymbol *IN_PACKAGE;
static MLKSymbol *DECLARE;
static MLKSymbol *PROGN;
static MLKSymbol *TAGBODY;
@@ -72,6 +73,7 @@ static MLKSymbol *_LAMBDA;
sys = [MLKPackage findPackage:@"TOILET-SYSTEM"];
IF = [cl intern:@"IF"];
+ IN_PACKAGE = [cl intern:@"IN-PACKAGE"];
DECLARE = [cl intern:@"DECLARE"];
PROGN = [cl intern:@"PROGN"];
TAGBODY = [cl intern:@"TAGBODY"];
@@ -208,6 +210,18 @@ static MLKSymbol *_LAMBDA;
inLexicalContext:context
withEnvironment:lexenv];
}
+ else if (car == IN_PACKAGE)
+ {
+ id cadr = [[program cdr] car];
+ id package = [MLKPackage findPackage:stringify(cadr)];
+
+ [[MLKDynamicContext currentContext]
+ setValue:package
+ forSymbol:[[MLKPackage findPackage:@"COMMON-LISP"]
+ intern:@"*PACKAGE*"]];
+
+ return [NSArray arrayWithObject:nullify(package)];
+ }
else if (car == _LAMBDA)
{
// A bare-bones LAMBDA without a real lambda list. What