return new Db_lam(this.body.debruijn(new_seq));
};
this.to_string = function (as_atom) {
- var base = "\\" + this.to_string_funct();
+ var base = "\\" + this.to_dotted();
if (as_atom) {
return "(" + base + ")";
} else {
return base;
}
};
- this.to_string_funct = function () {
- if (this.body.to_string_funct) {
- return this.bound.to_string() + " " + this.body.to_string_funct();
+ this.to_dotted = function () {
+ if (this.body.to_dotted) {
+ return this.bound.to_string() + " " + this.body.to_dotted();
} else {
return this.bound.to_string() + ". " + this.body.to_string();
}
return expr.eval_cbv(cbv > 1);
} else {
// return expr.eval_loop([], eta);
+ // using trampoline to reduce call stack overflows
var to_eval = expr, res = [[], eta];
while (to_eval !== null) {
res = to_eval.eval_loop.apply(to_eval, res);