From 47d502e02b4dc42d8192102c4e52764da09a90e5 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sun, 27 Jul 2008 11:11:45 +0200 Subject: Make MACROEXPAND-ALL an entry point to the minimal compiler. --- MLKRoot.m | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'MLKRoot.m') diff --git a/MLKRoot.m b/MLKRoot.m index d007173..a921c19 100644 --- a/MLKRoot.m +++ b/MLKRoot.m @@ -242,6 +242,18 @@ static id truify (BOOL value) RETURN_VALUE (form); } ++(NSArray *) macroexpand_all:(NSArray *)args +{ + id form = [args objectAtIndex:0]; + id env = [args count] > 1 ? denullify([args objectAtIndex:1]) : nil; + MLKLexicalContext *context = env ? (id)env : (id)[MLKLexicalContext globalContext]; + + return [MLKInterpreter eval:form + inLexicalContext:context + withEnvironment:nil + expandOnly:YES]; +} + +(NSArray *) shadow:(NSArray *)args { id symbols = denullify ([args objectAtIndex:0]); -- cgit v1.2.3