FelixBrendel 7 anni fa
parent
commit
b978f8b2b2
2 ha cambiato i file con 2 aggiunte e 44 eliminazioni
  1. +0
    -43
      src/built_ins.cpp
  2. +2
    -1
      todo.org

+ 0
- 43
src/built_ins.cpp Vedi File

@@ -51,13 +51,6 @@ proc load_built_ins_into_environment(Environment* env) -> void {
Lisp_Object* evaluated_arguments;

#define cLambda [=](Lisp_Object* arguments, Environment* env) mutable -> Lisp_Object*
#define report_error(_type) { \
if (log_level == Log_Level::Debug) { \
printf("Error occurred\nin %s:%d\n", __FILE__, __LINE__); \
} \
create_error(_type, current_source_code_location); \
return nullptr; \
}

proc defun = [&](const char* name, auto fun) {
define_symbol(
@@ -347,41 +340,6 @@ proc load_built_ins_into_environment(Environment* env) -> void {

return value;
});
// defun("define-upwards", cLambda {
// try {
// arguments_length = list_length(arguments);
// }

// if (arguments_length != 2) {
// report_error(Error_Type::Wrong_Number_Of_Arguments);
// }

// Lisp_Object* symbol = arguments->value.pair.first;

// if (symbol->type == Lisp_Object_Type::Pair) {
// try {
// symbol = eval_expr(symbol, env);
// }
// }

// if (symbol->type != Lisp_Object_Type::Symbol) {
// report_error(Error_Type::Type_Missmatch);
// }

// if (!env->parent) {
// report_error(Error_Type::Unknown_Error);
// }


// Lisp_Object* value = arguments->value.pair.rest->value.pair.first;
// try {
// value = eval_expr(value, env);
// }

// define_symbol(symbol, value, env->parent);

// return value;
// });
defun("mutate", cLambda {
try evaluated_arguments = eval_arguments(arguments, env, &arguments_length);
try assert_arguments_length(2, arguments_length);
@@ -969,6 +927,5 @@ proc load_built_ins_into_environment(Environment* env) -> void {
return Memory::create_lisp_object_string(resulting_string);
});

#undef report_error
#undef cLambda
}

+ 2
- 1
todo.org Vedi File

@@ -1,4 +1,5 @@
* TODO rename sliem to plisk
* TODO rename slime to plisk
* TODO go through sicp and use the examples as test files
* TODO BUG 1: eval dot notation
#+BEGIN_SRC lisp
(eval `(+ . ,(list 1 2 3)))


Caricamento…
Annulla
Salva