diff options
author | Matthias Benkard <mulk@Minimulk.local> | 2008-08-24 18:44:05 +0200 |
---|---|---|
committer | Matthias Benkard <mulk@Minimulk.local> | 2008-08-24 18:44:05 +0200 |
commit | f403bb6e9b0c64e2ce05eaf382c95884e753644e (patch) | |
tree | e90e54bb8bd0b546dba671741d9a2d062707fefb | |
parent | 03f8b9a2dd1a41baee46fd82e07545ad7c10986d (diff) |
Promote special operator EVAL to an intrinsic function.
-rw-r--r-- | MLKForm.m | 1 | ||||
-rw-r--r-- | MLKPackage.m | 2 | ||||
-rw-r--r-- | MLKRoot.m | 8 | ||||
-rw-r--r-- | special-symbols.h | 2 |
4 files changed, 9 insertions, 4 deletions
@@ -130,7 +130,6 @@ id car = [object car]; if (car == CATCH) return [MLKCatchForm class]; - else if (car == EVAL) return [MLKFunctionCallForm class]; else if (car == EVAL_WHEN) return [MLKEvalWhenForm class]; else if (car == _FOREIGN_LAMBDA) return [MLKForeignLambdaForm class]; else if (car == FUNCTION) return [MLKFunctionForm class]; diff --git a/MLKPackage.m b/MLKPackage.m index 6d97652..d432465 100644 --- a/MLKPackage.m +++ b/MLKPackage.m @@ -98,7 +98,6 @@ static NSMutableDictionary *packages = nil; [cl export:[cl intern:@"DECLARE"]]; [cl export:[cl intern:@"QUOTE"]]; [cl export:[cl intern:@"VALUES"]]; - [cl export:[cl intern:@"EVAL"]]; [cl export:[cl intern:@"SPECIAL"]]; [cl export:[cl intern:@"UNWIND-PROTECT"]]; [cl export:[cl intern:@"MULTIPLE-VALUE-CALL"]]; @@ -155,6 +154,7 @@ static NSMutableDictionary *packages = nil; [sys export:[sys intern:@"COMPILE"]]; [sys export:[sys intern:@"SET"]]; [sys export:[sys intern:@"APPLY"]]; + [sys export:[sys intern:@"EVAL"]]; [sys export:[sys intern:@"OBJC-CLASS-OF"]]; [sys export:[sys intern:@"OBJC-SUBCLASSP"]]; @@ -776,4 +776,12 @@ as provided by method %@ of object %@", ? (id)[arglist array] : (id)[NSArray array])]; } + ++(NSArray *) eval:(NSArray *)args +{ + id evaluand = denullify ([args objectAtIndex:0]); + return [MLKInterpreter eval:evaluand + inLexicalContext:[MLKLexicalContext globalContext] + withEnvironment:[MLKLexicalEnvironment globalEnvironment]]; +} @end diff --git a/special-symbols.h b/special-symbols.h index 806c758..d0f93b0 100644 --- a/special-symbols.h +++ b/special-symbols.h @@ -38,7 +38,6 @@ static MLKSymbol *LET; static MLKSymbol *LOCALLY; static MLKSymbol *FUNCALL; static MLKSymbol *FUNCTION; -static MLKSymbol *EVAL; static MLKSymbol *EVAL_WHEN; static MLKSymbol *QUOTE; static MLKSymbol *SETQ; @@ -87,7 +86,6 @@ ensure_symbols () _FLET = [sys intern:@"%FLET"]; _MACROLET = [sys intern:@"%MACROLET"]; _LOOP = [sys intern:@"%LOOP"]; - EVAL = [cl intern:@"EVAL"]; EVAL_WHEN = [cl intern:@"EVAL-WHEN"]; FUNCALL = [cl intern:@"FUNCALL"]; FUNCTION = [cl intern:@"FUNCTION"]; |