'let*' and 'letrec' are the same thing, they are just differently named in different LISPs. I implemented is yesterday as 'letr', I thought 'letrec' is too long to type for a function which will be used by some people quite often so 'letr' it will be in version 8.2.6
Lutz wrote:'let*' and 'letrec' are the same thing, they are just differently named in different LISPs.
Scheme has both let* and letrec, and they are not the same thing.
let* allows each expression to refer to variables defined above it. It guarantees that expressions will be evaluated in order. Common Lisp has the same let*.
letrec allows each expression to refer to any variable in the group, but all references must be made inside function closures - it must be possible to evaluate all expressions to values before binding any variable. Expressions may be evaluated in arbitrary order.