fixing bug in for where lambda body was self-evaluating

This commit is contained in:
JeffBezanson 2008-12-12 21:06:20 +00:00
parent 6962211e76
commit ee9f565d89
2 changed files with 4 additions and 1 deletions

View File

@ -1163,7 +1163,8 @@ static value_t eval_sexpr(value_t e, uint32_t penv, int tail)
f = Stack[SP-5];
Stack[SP-3] = car_(f); // lambda list
Stack[SP-2] = fixnum(s); // argument value
v = eval_sexpr(car_(cdr_(f)), SP-3, 0);
v = car_(cdr_(f));
if (!selfevaluating(v)) v = eval_sexpr(v, SP-3, 0);
}
break;
case F_SPECIAL_APPLY:

View File

@ -66,6 +66,8 @@
(assert (equal (string 'sym #char(65) #wchar(945) "blah") "symA\u03B1blah"))
; this crashed once
(for 1 10 (lambda (i) 0))
; ok, a couple end-to-end tests as well
(define (fib n) (if (< n 2) n (+ (fib (- n 1)) (fib (- n 2)))))