Some ops support several args e.g. (+ 1 2 3)

This commit is contained in:
= 2020-05-06 06:00:40 +01:00
parent 6616cadbd5
commit f2c09c0818
2 changed files with 5 additions and 2 deletions

View File

@ -224,10 +224,14 @@ Object eval(const Object *obj, struct Environment *env)
Object rest[length];
eval_forms(rest, obj, env);
Object func_eval = first_eval.func(rest[0], rest[1]);
Object func_eval = rest[0];
for(int i = 1; i < length; i++) {
func_eval = first_eval.func(func_eval, rest[i]);
}
// deleteList(obj);
return func_eval;
} else if (first_eval.type == TYPE_LAMBDA) {
struct Environment newEnv =
envForLambda(&first_eval.lambda->params, first_form->forward, env);

View File

@ -5,7 +5,6 @@
#include <stdio.h>
#else
#include <pebble.h>
// #define printf(...) nf_tokenize(NULL)
#endif
/*