From 2146926780f43bc7318cc258ae492263f5b55a50 Mon Sep 17 00:00:00 2001 From: fumfar hiwi Date: Wed, 8 Jan 2020 13:35:32 +0100 Subject: [PATCH] Pathetic try to get macros to work with the non recursive version --- bin/pre.slime | 2 ++ bin/slime.rdbg | Bin 556 -> 294 bytes src/eval.cpp | 15 +++++++++++++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/bin/pre.slime b/bin/pre.slime index 7ac5e01..664a33a 100644 --- a/bin/pre.slime +++ b/bin/pre.slime @@ -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. diff --git a/bin/slime.rdbg b/bin/slime.rdbg index 2e9e6c80880b38d62958b4ce7409085091a65c11..30b599177a6e8301c8264dd211f1641d8f2dbc0f 100644 GIT binary patch literal 294 zcma)%!3qK~3`8sVJJy5X!JE3Q_l3RX(yfsVwl*Y1cK_a1KfneiB!|b$4Bh2sjWO2~ zjEbVrp9knrpE)t~7-#_v6cHwR{Vt0O7T`PEvUf%PAFbj6-!53syl({}#w2S+jxESR h?(oPHI1#r7(rjnu+N~{}NRsMR0JABo-SSLY{||LqU(x^o literal 556 zcmaix!Ab)$5QY~$dGQ$*#M&MjcCD!N(1RB0Q9KWnn2c-aZnDf|yW6*SQYm2LUoML{)xb3 zpur~4L7BFloMmyZ>qOoP`TxU`75zSe;}bZ7M1fAXk2@Rfd?IIOb4KLoe3jrdfN^cB ziShm<9%ngHXCfz9yxFDHwbZ0RW?kWYWp&gSa^m8RbWPQkTQu|44i9}Gt7L#3vhp~@ Kt^6epLS;X*X|>D% diff --git a/src/eval.cpp b/src/eval.cpp index fe453ec..c3e888b 100644 --- a/src/eval.cpp +++ b/src/eval.cpp @@ -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 = [&] { /* | | | | | | -> | | @@ -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); }