+okay the problem:
+(cons 1 (cons 2 nil))
+goes to (cons 1 (2))
+which evaluates down to
+(cons 1 2)
+which is
+(1 . 2)
+how do I get the expected result of (1 2)?
+
+I think I need to figure out how to properly abuse quotes?
+
so i'm redoing the basic eval to not pass an arg, but pass the rest of the list... yeah?
then the builtins just harvest the rest one at a time to get all their args,
Sexpr* c_cons(Sexpr* b, Sexpr* rest, Sexpr* env) {
if(CORE_CONS_ARGS != u64_get_num_args(b))
return cons(b, rest);
+ // big problem: need to rewrite to wiggle around quotes
Sexpr* args = b->value.b.args;
Sexpr* _cdr = eval(car(args), env);
+ if(_cdr->type == QUOTE)
+ _cdr = _cdr->value.q;
Sexpr* _car = eval(car(cdr(args)), env);
- return cons(cons(_car, _cdr), rest);
+ if(_car->type == QUOTE)
+ _car = _car->value.q;
+ return cons(from_quote(cons(_car, _cdr)), rest);
}
Sexpr* c_car(Sexpr* b, Sexpr* rest, Sexpr* env) {
if(CORE_CAR_ARGS != u64_get_num_args(b))