diff options
author | Matthias Andreas Benkard <matthias@benkard.de> | 2008-06-27 12:44:25 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <matthias@benkard.de> | 2008-06-27 12:44:25 +0200 |
commit | cb23a76bbd3b7b1ccf4a5ec8894437e449a9047d (patch) | |
tree | c3a2a88747a51bf02a4ca028b9a12462eb549ec7 /MLKLexicalEnvironment.m | |
parent | 01703b9a42e4dac6ae83127ba8fc224e6f581c92 (diff) |
MLKInterpreter: Implement the %LAMBDA operator.
Diffstat (limited to 'MLKLexicalEnvironment.m')
-rw-r--r-- | MLKLexicalEnvironment.m | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/MLKLexicalEnvironment.m b/MLKLexicalEnvironment.m index 66d5cb2..61f09c2 100644 --- a/MLKLexicalEnvironment.m +++ b/MLKLexicalEnvironment.m @@ -68,15 +68,24 @@ static MLKLexicalEnvironment *global_environment; -(MLKLexicalEnvironment *) initWithParent:(MLKLexicalEnvironment *)aContext variables:(NSDictionary *)vars - functions:(NSDictionary *)handlers + functions:(NSDictionary *)functions { self = [super init]; ASSIGN (_parent, (aContext ? aContext : global_environment)); _variables = MAKE_ENVIRONMENT(vars, _parent, _parent->_variables); - _functions = MAKE_ENVIRONMENT(handlers, _parent, _parent->_functions); + _functions = MAKE_ENVIRONMENT(functions, _parent, _parent->_functions); return self; } ++(MLKLexicalEnvironment *) environmentWithParent:(MLKLexicalEnvironment *)context + variables:(NSDictionary *)vars + functions:(NSDictionary *)functions +{ + return AUTORELEASE ([[self alloc] initWithParent:context + variables:vars + functions:functions]); +} + +(MLKLexicalEnvironment *) globalEnvironment { return global_environment; |