Pathetic try to get macros to work with the non recursive version
This commit is contained in:
@@ -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.
|
||||||
|
|||||||
Binary file not shown.
+13
-2
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user