diff options
-rw-r--r-- | MLKEnvironment.m | 9 | ||||
-rw-r--r-- | MLKInterpreter.m | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/MLKEnvironment.m b/MLKEnvironment.m index 2dab2aa..581c462 100644 --- a/MLKEnvironment.m +++ b/MLKEnvironment.m @@ -74,7 +74,9 @@ static id UNBOUND; -(void) setValue:(id)value forBinding:(MLKSymbol *)symbol; { - [self setBinding:symbol to:value inEnvironment:self]; + [self setBinding:(symbol ? (id)symbol : (id)[NSNull null]) + to:value + inEnvironment:self]; } -(void) setBinding:(MLKSymbol *)symbol to:(id)value inEnvironment:(MLKEnvironment *)env @@ -93,7 +95,8 @@ static id UNBOUND; -(id) valueForBinding:(MLKSymbol *)symbol { - return [self valueForBinding:symbol inEnvironment:self]; + return [self valueForBinding:(symbol ? (id)symbol : (id)[NSNull null]) + inEnvironment:self]; } -(id) valueForBinding:(MLKSymbol *)symbol inEnvironment:(MLKEnvironment *)env @@ -134,7 +137,7 @@ static id UNBOUND; -(void) addBinding:(MLKSymbol *)symbol { - [_bindings setObject:UNBOUND forKey:symbol]; + [_bindings setObject:UNBOUND forKey:(symbol ? (id)symbol : (id)[NSNull null])]; } -(MLKEnvironment *) environmentForBinding:(MLKSymbol *)symbol diff --git a/MLKInterpreter.m b/MLKInterpreter.m index 1f158ec..a8b94ee 100644 --- a/MLKInterpreter.m +++ b/MLKInterpreter.m @@ -48,6 +48,7 @@ static MLKSymbol *FUNCALL; static MLKSymbol *EVAL; static MLKSymbol *QUOTE; static MLKSymbol *SETQ; +static MLKSymbol *PROGV; static MLKSymbol *_DEFMACRO; @@ -69,6 +70,7 @@ static MLKSymbol *_DEFMACRO; EVAL = [cl intern:@"EVAL"]; QUOTE = [cl intern:@"QUOTE"]; SETQ = [cl intern:@"SETQ"]; + PROGV = [cl intern:@"PROGV"]; _DEFMACRO = [sys intern:@"%DEFMACRO"]; } |