summaryrefslogtreecommitdiff
path: root/environment.cpp
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2016-11-20 21:05:01 +0100
committertomsmeding <tom.smeding@gmail.com>2016-11-20 21:05:01 +0100
commit979325946b938be7cbe51f8c20c44e457107979f (patch)
treef6814eb3af59fea8d2f8fe25117a1c88557ae474 /environment.cpp
parent834cb55baadb9dd7c3a4ad096d81259d0868eeb9 (diff)
Sugar and prelude extension
Diffstat (limited to 'environment.cpp')
-rw-r--r--environment.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/environment.cpp b/environment.cpp
index 3ca55b1..b38d73b 100644
--- a/environment.cpp
+++ b/environment.cpp
@@ -5,7 +5,7 @@
using namespace std;
-#undef DEBUG
+#define DEBUG
void Environment::load(const Environment &other){
@@ -25,14 +25,6 @@ void Environment::define(const Name &name,const Hook &hook){
hooks[name]=hook;
}
-void Environment::define2(const Name &name,const Hook2 &hook2){
- hooks[name]=[hook2](Environment &env,const AST &arg1) -> AST {
- return AST::makeNative([&env,arg1,hook2](const AST &arg2) -> AST {
- return hook2(env,arg1,arg2);
- });
- };
-}
-
AST Environment::get(const Name &name){
auto it=defs.find(name);
if(it==defs.end()){
@@ -277,7 +269,7 @@ static bool hasFree(AST &ast,Index fromIndex){
return false;
case AST::Type::name:
- return true;
+ return false;
case AST::Type::index:
return ast.indexval>=fromIndex;