summaryrefslogtreecommitdiff
path: root/prelude.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'prelude.cpp')
-rw-r--r--prelude.cpp16
1 files changed, 14 insertions, 2 deletions
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 {