summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MLKReadEvalPrintLoop.m4
-rw-r--r--MLKRoot.m12
2 files changed, 13 insertions, 3 deletions
diff --git a/MLKReadEvalPrintLoop.m b/MLKReadEvalPrintLoop.m
index 092c6bd..f2a7803 100644
--- a/MLKReadEvalPrintLoop.m
+++ b/MLKReadEvalPrintLoop.m
@@ -99,8 +99,6 @@ static const char *prompt (EditLine *e) {
}
NS_ENDHANDLER;
- RELEASE (pool);
-
printf ("Done.\n\n");
printf ("This is Toilet Lisp, version 0.0.1.\n");
@@ -112,6 +110,8 @@ static const char *prompt (EditLine *e) {
forSymbol:[[MLKPackage findPackage:@"TOILET-SYSTEM"]
intern:@"*SYSTEM-INITIALISED-P*"]];
+ RELEASE (pool);
+
while (1)
{
const char *line;
diff --git a/MLKRoot.m b/MLKRoot.m
index f155733..e3680f3 100644
--- a/MLKRoot.m
+++ b/MLKRoot.m
@@ -229,12 +229,22 @@ static id truify (BOOL value)
id form = [args objectAtIndex:0];
id env = [args count] > 1 ? denullify([args objectAtIndex:1]) : nil;
MLKLexicalContext *context = env ? (id)env : (id)[MLKLexicalContext globalContext];
+ id <MLKFuncallable> macrofun = nil;
if ([form isKindOfClass:[MLKCons class]]
&& (![form car] || [[form car] isKindOfClass:[MLKSymbol class]])
&& [context symbolNamesMacro:[form car]])
{
- id <MLKFuncallable> macrofun = [context macroForSymbol:[form car]];
+ macrofun = [context macroForSymbol:[form car]];
+ }
+ else if ([form isKindOfClass:[MLKSymbol class]]
+ && [context symbolNamesSymbolMacro:form])
+ {
+ macrofun = [context symbolMacroForSymbol:[form car]];
+ }
+
+ if (macrofun)
+ {
form = denullify ([[macrofun applyToArray:
[NSArray arrayWithObjects:
form, context, nil]]