From d42ada70efa30da0b6571e1e3dd65ce676b824a8 Mon Sep 17 00:00:00 2001 From: FelixBrendel Date: Thu, 26 Sep 2019 18:11:08 +0200 Subject: [PATCH] default args are eveled at current environment now --- build.sh | 0 src/built_ins.cpp | 12 +++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) mode change 100755 => 100644 build.sh diff --git a/build.sh b/build.sh old mode 100755 new mode 100644 diff --git a/src/built_ins.cpp b/src/built_ins.cpp index e3db208..e02506b 100644 --- a/src/built_ins.cpp +++ b/src/built_ins.cpp @@ -173,9 +173,9 @@ proc load_built_ins_into_environment() -> void { auto label(sym,__LINE__) = label(params,__LINE__)->value.pair.first; \ auto label(sfun,__LINE__) = Memory::create_lisp_object_cfunction(special); \ /*NOTE(Felix): for evaluating default args*/ \ - push_environment(get_root_environment()); \ + /*push_environment(get_root_environment());*/ \ create_arguments_from_lambda_list_and_inject(label(params,__LINE__)->value.pair.rest, label(sfun,__LINE__)); \ - pop_environment(); \ + /*pop_environment(); */ \ label(sfun,__LINE__)->sourceCodeLocation = new(Source_Code_Location); \ label(sfun,__LINE__)->sourceCodeLocation->file = file_name_built_ins; \ label(sfun,__LINE__)->sourceCodeLocation->line = __LINE__; \ @@ -190,7 +190,13 @@ proc load_built_ins_into_environment() -> void { Globals::Current_Execution::envi_stack.next_index, \ Globals::Current_Execution::envi_stack.next_index-1) - + define((helper), "") { + return Memory::create_lisp_object_number(101); + }; + define((test (:k (helper))), "") { + fetch(k); + return k; + }; define((= . args), "Takes 0 or more arguments and returns =t= if all arguments are equal " "and =()= otherwise.")