(def D (B B))
-(def g (D S (C (eq 0) 1) (D S * (C B (C - 1)))))
+(def fachelp (D S (C (eq 0) 1) (D S * (C B (C - 1)))))
+
+(def fac (Z fachelp))
+
+(def rh (B B S (S (B (eq 0) car) cdr) (C B (Phi cons (B (C - 1) car) (Phi cons car cdr)))))
+
+(def range (S (C (eq 0) nil) (B (Z rh) (C cons nil))))
+
+(def fph (B (S (Phi (eq nil) cdr car)) (C B (Phi cons (Phi + car (B car cdr)) (B cdr cdr)))))
-(def fac (Z g))
\ No newline at end of file
}
Sexpr* args = b->value.b.args;
Sexpr* g = clone(car(cdr(args)));
- Sexpr* v = clone(car(args));
+ Sexpr* v = eval(clone(car(args)), env);
+ // man that eval does a /lot/ for computation,
+ // need to think about what this implies
sexpr_free(b);
Sexpr* g2 = clone(g);
Sexpr* z = from_opcode((COMB_PREFIX << 8) | COMB_Z);