瀏覽代碼

default args are eveled at current environment now

master
FelixBrendel 6 年之前
父節點
當前提交
d42ada70ef
共有 2 個文件被更改,包括 9 次插入3 次删除
  1. +0
    -0
     
  2. +9
    -3
      src/built_ins.cpp

+ 0
- 0
查看文件


+ 9
- 3
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.")


Loading…
取消
儲存