From 979325946b938be7cbe51f8c20c44e457107979f Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sun, 20 Nov 2016 21:05:01 +0100 Subject: Sugar and prelude extension --- environment.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'environment.cpp') 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; -- cgit v1.2.3-70-g09d2