Home > Archive > Scheme > December 2004 > What is letrec* ?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Andrew Wilcox 2004-12-07, 4:04 pm |
| I noticed in the revised progress report on R6RS
(http://schemers.org/Documents/Stand.../2004-10-13.pdf), one of
the extensions under consideration is to "add letrec*, and define
internal =define= in terms of it".
What is letrec* ? Is it simply a letrec with the init expressions
evaluated in a specific left-to-right order?
In a letrec*, can later variables depend on the values of earlier
values? For example, with internal =define='s defined with letrec*,
would the following work or not?
(let ()
(define (add-10 x) (+ x 10))
(define ten (add-10 0))
(define twenty (add-10 ten))
(list ten twenty))
Thank you,
Andrew Wilcox
email: scheme[at]andrewwilcox.name
| |
| Michael Sperber 2004-12-07, 4:04 pm |
| >>>>> "Andrew" == Andrew Wilcox <scheme@andrewwilcox.name> writes:
Andrew> What is letrec* ? Is it simply a letrec with the init expressions
Andrew> evaluated in a specific left-to-right order?
Yes.
Andrew> In a letrec*, can later variables depend on the values of earlier
Andrew> values?
Yes.
Andrew> For example, with internal =define='s defined with letrec*,
Andrew> would the following work or not?
Andrew> (let ()
Andrew> (define (add-10 x) (+ x 10))
Andrew> (define ten (add-10 0))
Andrew> (define twenty (add-10 ten))
Andrew> (list ten twenty))
Yes.
--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
|
|
|
|
|