|
|
|
@@ -170,7 +170,7 @@ proc load_built_ins_into_environment() -> void { |
|
|
|
); \ |
|
|
|
assert_type(label(params,__LINE__), Lisp_Object_Type::Pair); \ |
|
|
|
assert_type(label(params,__LINE__)->value.pair.first, Lisp_Object_Type::Symbol); \ |
|
|
|
auto label(sym,__LINE__) = label(params,__LINE__)->value.pair.first; \ |
|
|
|
static 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());*/ \ |
|
|
|
@@ -190,13 +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((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.") |
|
|
|
@@ -354,6 +354,19 @@ proc load_built_ins_into_environment() -> void { |
|
|
|
return Memory::create_lisp_object_number((int)a->value.number % |
|
|
|
(int)b->value.number); |
|
|
|
}; |
|
|
|
define((get-random-between a b), "TODO") { |
|
|
|
fetch(a, b); |
|
|
|
try assert_type(a, Lisp_Object_Type::Number); |
|
|
|
try assert_type(b, Lisp_Object_Type::Number); |
|
|
|
|
|
|
|
double fa = a->value.number; |
|
|
|
double fb = b->value.number; |
|
|
|
double x = (double)rand()/(double)(RAND_MAX); |
|
|
|
x *= (fb - fa); |
|
|
|
x += fa; |
|
|
|
|
|
|
|
return Memory::create_lisp_object_number(x); |
|
|
|
}; |
|
|
|
define((assert test), "TODO") { |
|
|
|
fetch(test); |
|
|
|
|
|
|
|
|