[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: letrec bug
From: |
Mikael Djurfeldt |
Subject: |
Re: letrec bug |
Date: |
Tue, 28 Oct 2008 22:21:21 +0100 |
2008/10/28 Mikael Djurfeldt <address@hidden>:
> 2008/10/28 Bill Schottstaedt <address@hidden>:
>> I believe this shows a bug in letrec:
>>
>> guile> (let ((x 1)) (let ((x 32) (y x)) y))
>> 1
>> guile> (let ((x 1)) (letrec ((x 32) (y x)) y))
>>
>> Backtrace:
>> In standard input:
>> 2: 0* (let* ((x 1)) (letrec ((x 32) (y x)) y))
>> 2: 1 (letrec ((x 32) (y x)) y)
>>
>> standard input:2:14: In expression (letrec (# #) y):
>> standard input:2:14: Variable used before given a value: x
>> ABORT: (unbound-variable)
>
> Nope.
>
> From R5RS:
>
> "One restriction on `letrec' is very important: it must be possible
> to evaluate each <init> without assigning or referring to the
> value of any <variable>."
Sorry. I missed the surrounding let. Yes, it is a bug.
- letrec bug, Bill Schottstaedt, 2008/10/28
- Re: letrec bug, Mikael Djurfeldt, 2008/10/28
- Re: letrec bug,
Mikael Djurfeldt <=