summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-08-13 11:04:55 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-08-13 11:04:55 +0200
commita8a3de11ce7219d9567fb5d341276325f8df04be (patch)
treeeca8a81f6d410ac3eac148463b41a955ae935a3e
parent1d741f977203814b9c5b0b5d524af25eff27a3c1 (diff)
Add COMPILE.
-rw-r--r--MLKPackage.m1
-rw-r--r--MLKRoot.m12
2 files changed, 13 insertions, 0 deletions
diff --git a/MLKPackage.m b/MLKPackage.m
index a05f822..acaf6db 100644
--- a/MLKPackage.m
+++ b/MLKPackage.m
@@ -154,6 +154,7 @@ static NSMutableDictionary *packages = nil;
[sys export:[sys intern:@"FIXNUM-EQ"]];
[sys export:[sys intern:@"DECLARATIONS-AND-DOC-AND-FORMS"]];
[sys export:[sys intern:@"DECLARATIONS-AND-FORMS"]];
+ [sys export:[sys intern:@"COMPILE"]];
[sys export:[sys intern:@"OBJC-CLASS-OF"]];
[sys export:[sys intern:@"OBJC-SUBCLASSP"]];
diff --git a/MLKRoot.m b/MLKRoot.m
index 940181c..a003912 100644
--- a/MLKRoot.m
+++ b/MLKRoot.m
@@ -22,6 +22,7 @@
#import "MLKDynamicContext.h"
#import "MLKInterpretedClosure.h"
#import "MLKInterpreter.h"
+#import "MLKLLVMCompiler.h"
#import "MLKNumber.h"
#import "MLKPackage.h"
#import "MLKRoot.h"
@@ -702,4 +703,15 @@ as provided by method %@ of object %@",
cons:forms
with:nil]]);
}
+
+
++(NSArray *) compile:(NSArray *)args
+{
+ NSLog (@"Compiling lambda form.");
+ id thing = [MLKLLVMCompiler compile:denullify([args objectAtIndex:0])
+ inContext:[MLKLexicalContext globalContext]];
+ NSLog (@"Compilation done.");
+ NSLog (@"Compiled: %@", thing);
+ RETURN_VALUE (thing);
+}
@end