This commit is contained in:
NunoSempere 2023-05-07 12:49:22 -04:00
parent 1dfba9f4a1
commit 2f9edb67e6

View File

@ -131,7 +131,8 @@ lispval* lispval_builtin_func(lispbuiltin func, char* builtin_func_name)
} }
lispenv* new_lispenv(); lispenv* new_lispenv();
lispval* lispval_lambda_func(lispval* variables, lispval* manipulation){ lispval* lispval_lambda_func(lispval* variables, lispval* manipulation)
{
lispval* v = malloc(sizeof(lispval)); lispval* v = malloc(sizeof(lispval));
v->type = LISPVAL_USER_FUNC; v->type = LISPVAL_USER_FUNC;
v->builtin_func = NULL; v->builtin_func = NULL;
@ -266,7 +267,6 @@ void delete_lispval(lispval* v)
free(v->cell); free(v->cell);
v->cell = NULL; v->cell = NULL;
if (VERBOSE) if (VERBOSE)
printfln("Freeing the v pointer"); printfln("Freeing the v pointer");
if (v != NULL) if (v != NULL)
@ -317,8 +317,6 @@ void destroy_lispenv(lispenv* env)
// so it isn't destroyed // so it isn't destroyed
} }
lispval* clone_lispval(lispval* old); lispval* clone_lispval(lispval* old);
lispval* get_from_lispenv(char* sym, lispenv* env) lispval* get_from_lispenv(char* sym, lispenv* env)
{ {
@ -749,7 +747,8 @@ lispval* builtin_def(lispval* v, lispenv* env)
} }
// A builtin for defining a function // A builtin for defining a function
lispval* builtin_define_lambda(lispval* v, lispenv* env){ lispval* builtin_define_lambda(lispval* v, lispenv* env)
{
// @ { {x y} { + x y } } // @ { {x y} { + x y } }
// def { {plus} {{@ {x y} {+ x y}} }} // def { {plus} {{@ {x y} {+ x y}} }}
// (eval plus) 1 2 // (eval plus) 1 2
@ -947,7 +946,6 @@ lispval* evaluate_lispval(lispval* l, lispenv* env)
lispval* operands = lispval_sexpr(); lispval* operands = lispval_sexpr();
for (int i = 1; i < l->count; i++) { for (int i = 1; i < l->count; i++) {
lispval_append_child(operands, l->cell[i]); lispval_append_child(operands, l->cell[i]);
} }
if (VERBOSE) if (VERBOSE)
printfln("Applying function to operands"); printfln("Applying function to operands");