From 76aa8a27f85fdea83da02e04659028b98e76407e Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Mon, 25 Aug 2008 10:54:18 +0200 Subject: Dispatch intrinsic functions statically instead of dynamically. This is a major simplification. --- MLKInterpreter.m | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'MLKInterpreter.m') diff --git a/MLKInterpreter.m b/MLKInterpreter.m index 9871cfa..ce5d328 100644 --- a/MLKInterpreter.m +++ b/MLKInterpreter.m @@ -63,8 +63,11 @@ #define RETURN_VALUE(thing) \ { return [NSArray arrayWithObject:nullify(thing)]; } + +static id PRIMARY (NSArray *array) __attribute__ ((pure)); + static id -PRIMARY (id array) +PRIMARY (NSArray *array) { if ([array count] > 0) return [array objectAtIndex:0]; @@ -653,24 +656,10 @@ PRIMARY (id array) if (![_context symbolNamesFunction:_head]) { - NSArray *results = nil; - - if (_head && [_head homePackage] == sys) - { - results = [MLKRoot dispatch:_head withArguments:args]; - } - - if (results) - { - return results; - } - else - { - [NSException raise:@"MLKNoSuchOperatorException" - format:@"%@ does not name a known operator.", - MLKPrintToString(_head)]; - return nil; - } + [NSException raise:@"MLKNoSuchOperatorException" + format:@"%@ does not name a known operator.", + MLKPrintToString(_head)]; + return nil; } else { -- cgit v1.2.3