summaryrefslogtreecommitdiff
path: root/MLKInterpreter.m
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-08-25 10:54:18 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-08-25 10:54:18 +0200
commit76aa8a27f85fdea83da02e04659028b98e76407e (patch)
tree448cd7515096c44368aa2b6e9cc07dcfff3c39f3 /MLKInterpreter.m
parentb268ec5ec85fd6da735491a8fbc7560037e613b5 (diff)
Dispatch intrinsic functions statically instead of dynamically.
This is a major simplification.
Diffstat (limited to 'MLKInterpreter.m')
-rw-r--r--MLKInterpreter.m27
1 files changed, 8 insertions, 19 deletions
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
{