diff --git a/bin/slime.rdbg b/bin/slime.rdbg new file mode 100644 index 0000000..e7085e0 Binary files /dev/null and b/bin/slime.rdbg differ diff --git a/src/eval.cpp b/src/eval.cpp index 5b20b4f..b54f788 100644 --- a/src/eval.cpp +++ b/src/eval.cpp @@ -252,13 +252,17 @@ proc apply_arguments_to_function(Lisp_Object* arguments, Lisp_Object* function, filling it in */ proc create_arguments_from_lambda_list_and_inject(Lisp_Object* arguments, Lisp_Object* function) -> void { - Arguments* result;; + Arguments* result; if (Memory::get_type(function) == Lisp_Object_Type::CFunction) { result = &function->value.cFunction->args; } else { result = &function->value.function.args; } + ::new ((&(result->positional.symbols))) Array_List; + ::new ((&(result->keyword.keywords))) Array_List; + ::new ((&(result->keyword.values))) Array_List; + // first init the fields // result->positional = create_positional_argument_list(16); // result->keyword = create_keyword_argument_list(16); diff --git a/src/forward_decls.cpp b/src/forward_decls.cpp index ba2e3c7..0344738 100644 --- a/src/forward_decls.cpp +++ b/src/forward_decls.cpp @@ -62,14 +62,6 @@ namespace Globals { Error* error = nullptr; } -bool hm_objects_match(char* a, char* b) { - return strcmp(a, b) == 0; -} - -bool hm_objects_match(void* a, void* b) { - return a == b; -} - unsigned int hm_hash(void* ptr) { return ((unsigned long long)ptr * 2654435761) % 4294967296; } @@ -83,6 +75,14 @@ unsigned int hm_hash(char* str) { return value ^ i; } +bool hm_objects_match(char* a, char* b) { + return strcmp(a, b) == 0; +} + +bool hm_objects_match(void* a, void* b) { + return a == b; +} + bool hm_objects_match(Lisp_Object* a, Lisp_Object* b) { return lisp_object_equal(a, b); } diff --git a/src/ftb b/src/ftb index e782aa7..dd7db5b 160000 --- a/src/ftb +++ b/src/ftb @@ -1 +1 @@ -Subproject commit e782aa70b7ad2a175f11683307e605ad805d5ad3 +Subproject commit dd7db5b3308b839995bfa211fb77ced6aa2f696e diff --git a/src/slime.h b/src/slime.h index 328675a..e9bcbbc 100644 --- a/src/slime.h +++ b/src/slime.h @@ -24,19 +24,11 @@ #include "./ftb/types.hpp" #include "./ftb/macros.hpp" #include "./ftb/profiler.hpp" - -struct Lisp_Object; -u32 hm_hash(Lisp_Object* obj); -unsigned int hm_hash(char* obj); -unsigned int hm_hash(void* obj); -bool hm_objects_match(void* a, void* b); -bool hm_objects_match(char* a, char* b); -bool hm_objects_match(Lisp_Object* a, Lisp_Object* b); - -#include "./ftb/hashmap.hpp" #include "./ftb/arraylist.hpp" namespace Slime { +#include "./ftb/hashmap.hpp" + # include "./defines.cpp" # include "./platform.cpp" # include "./structs.cpp" diff --git a/src/structs.cpp b/src/structs.cpp index 1936d56..b7a6920 100644 --- a/src/structs.cpp +++ b/src/structs.cpp @@ -33,9 +33,7 @@ enum struct Lisp_Object_Type { CFunction, }; -typedef uint64_t u64; - -enum class Lisp_Object_Flags : u64 +enum class Lisp_Object_Flags { // bits 1 to 5 (including) will be reserved for the type Already_Garbage_Collected = 1 << 5,