From 189d02b12aa33fc18eaff9558675d9fa9d6ba668 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Fri, 27 Jun 2008 14:42:33 +0200 Subject: MLKInterpreter: Fix APPLY and %LAMBDA. --- MLKInterpreter.m | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'MLKInterpreter.m') diff --git a/MLKInterpreter.m b/MLKInterpreter.m index 01a915f..7fc14d7 100644 --- a/MLKInterpreter.m +++ b/MLKInterpreter.m @@ -127,9 +127,13 @@ static MLKSymbol *_LAMBDA; inLexicalContext:context withEnvironment:lexenv]; - return [[[program cdr] car] applyToArray:(rest - ? (id)[rest array] - : (id)[NSArray array])]; + id function = [self eval:[[program cdr] car] + inLexicalContext:context + withEnvironment:lexenv]; + + return [function applyToArray:(rest + ? (id)[rest array] + : (id)[NSArray array])]; } else if (car == _DEFMACRO) { @@ -163,11 +167,11 @@ static MLKSymbol *_LAMBDA; // would be a lambda list in a real LAMBDA form must be a // symbol here. id lambdaList = [[program cdr] car]; - id body = [[[program cdr] cdr] cdr]; + id body = [[program cdr] cdr]; MLKInterpretedClosure *closure; closure = AUTORELEASE ([[MLKInterpretedClosure alloc] - initWithBodyForm:body + initWithBodyForms:body lambdaListName:lambdaList context:context environment:lexenv]); -- cgit v1.2.3