This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Bug with letrec???


Lars Arvestad <arve@nada.kth.se> writes:

> NP> it seems that letrec is not working correct?! I thought this is the
> NP> standard behaviour according to RnRS? What is the difference between
> NP> letrec and let in this case?
> 
> It works correct. Here is 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>.  If this restriction is violated, then it
>      is an error.  The restriction is necessary because Scheme passes
>      arguments by value rather than by name.  In the most common uses
>      of `letrec', all the <init>s are lambda expressions and the
>      restriction is satisfied automatically.

an interesting thing is that at least in Scsh and MzScheme letrec
works as Norbert expected.  but yes, per R5RS it doesn't have to.

-- 
"What did we agree about a leader??"
"We agreed we wouldn't have one."
"Good.  Now shut up and do as I say..."

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]