From 834cb55baadb9dd7c3a4ad096d81259d0868eeb9 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sun, 20 Nov 2016 17:02:08 +0100 Subject: Fix reducing bigtime --- prelude.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'prelude.cpp') diff --git a/prelude.cpp b/prelude.cpp index eb503b0..cd51cad 100644 --- a/prelude.cpp +++ b/prelude.cpp @@ -18,6 +18,14 @@ const AST afterBootstrap=AST(R"RAW( (def 'print (. putstr repr))) )RAW"); +static AST dofunction(const AST&); + +const AST doNative=AST::makeNative(dofunction); + +static AST dofunction(const AST&){ + return doNative; +} + class PreludeInit{ public: PreludeInit(Environment &intoEnv){ @@ -46,8 +54,12 @@ public: }); }); - intoEnv.define("do",AST::makeNative([](const AST&) -> AST { - throw logic_error("'do' stub called; this should not happen"); + intoEnv.define("do",doNative); + + intoEnv.define("unquote",AST::makeNative([](const AST &ast) -> AST { + AST res(ast); + res.quoted=false; + return res; })); intoEnv.define2("+",[](Environment&,const AST &arg1,const AST &arg2) -> AST { -- cgit v1.2.3-70-g09d2