Browse Source

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

master
fumfar hiwi 6 years ago
parent
commit
2146926780
3 changed files with 15 additions and 2 deletions
  1. +2
    -0
      bin/pre.slime
  2. BIN
     
  3. +13
    -2
      src/eval.cpp

+ 2
- 0
bin/pre.slime View File

@@ -17,6 +17,8 @@
(define (force promise)
(promise))

(define-syntax (mac a) (list + 1 1))

(define-syntax (when condition . body)
:doc "Special form for when multiple actions should be done if a
condition is true.


BIN
View File


+ 13
- 2
src/eval.cpp View File

@@ -687,6 +687,7 @@ namespace Slime {
case Action::Pop: return "Pop";
case Action::If: return "If";
}
return "??";
}());
}
printf("\nams:\n ");
@@ -696,6 +697,13 @@ namespace Slime {
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 = [&] {
/* | | | <test> |
| | -> | <then> |
@@ -831,7 +839,8 @@ namespace Slime {
else if (pc == Memory::_begin) try handle_begin();
else if (pc == Memory::_define) try handle_define();
else {
// push_pc_on_cs();
push_pc_on_cs();
nas.append(Action::Step);
}
} else {
nas.append(Action::Step);
@@ -839,7 +848,9 @@ namespace Slime {
} break;
case Lisp_Object_Type::Function: {
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 {
nas.append(Action::Step);
}


Loading…
Cancel
Save