Pathetic try to get macros to work with the non recursive version

This commit is contained in:
fumfar hiwi
2020-01-08 13:35:32 +01:00
parent f767736064
commit 2146926780
3 changed files with 15 additions and 2 deletions
+2
View File
@@ -17,6 +17,8 @@
(define (force promise) (define (force promise)
(promise)) (promise))
(define-syntax (mac a) (list + 1 1))
(define-syntax (when condition . body) (define-syntax (when condition . body)
:doc "Special form for when multiple actions should be done if a :doc "Special form for when multiple actions should be done if a
condition is true. condition is true.
BIN
View File
Binary file not shown.
+13 -2
View File
@@ -687,6 +687,7 @@ namespace Slime {
case Action::Pop: return "Pop"; case Action::Pop: return "Pop";
case Action::If: return "If"; case Action::If: return "If";
} }
return "??";
}()); }());
} }
printf("\nams:\n "); printf("\nams:\n ");
@@ -696,6 +697,13 @@ namespace Slime {
pause(); pause();
}; };
proc push_pc_on_cs = [&] {
for_lisp_list (pcs.data[pcs.next_index-1]) {
cs.append(it);
}
pcs.data[pcs.next_index-1] = Memory::nil;
};
proc handle_if = [&] { proc handle_if = [&] {
/* | | | <test> | /* | | | <test> |
| | -> | <then> | | | -> | <then> |
@@ -831,7 +839,8 @@ namespace Slime {
else if (pc == Memory::_begin) try handle_begin(); else if (pc == Memory::_begin) try handle_begin();
else if (pc == Memory::_define) try handle_define(); else if (pc == Memory::_define) try handle_define();
else { else {
// push_pc_on_cs(); push_pc_on_cs();
nas.append(Action::Step);
} }
} else { } else {
nas.append(Action::Step); nas.append(Action::Step);
@@ -839,7 +848,9 @@ namespace Slime {
} break; } break;
case Lisp_Object_Type::Function: { case Lisp_Object_Type::Function: {
if (pc->value.function->type == Function_Type::Macro) { if (pc->value.function->type == Function_Type::Macro) {
// push_pc_on_cs(); push_pc_on_cs();
nas.append(Action::Eval);
nas.append(Action::Step);
} else { } else {
nas.append(Action::Step); nas.append(Action::Step);
} }