Closed GoogleCodeExporter closed 9 years ago
According to discussions(*1) in comp.lang.scheme which I referenced to implement
letrec and letrec* in Ypsilon 0.9.6, I think letrec in expression:
> (define (test c)
> (letrec ((a (+ c 13))
> (b (+ a 90)))
> (+ a b)))
is invalid and R6RS implementation is responsible to raise assertion-violation
at
runtime(*2).
*1
http://groups.google.com/group/comp.lang.scheme/browse_thread/thread/a43607cc117
055f8/0334c1df3ebb85f9
http://groups.google.com/group/comp.lang.scheme/browse_thread/thread/a7d691b5ca8
7b94f/c7ce67ffc1f988ca
*2
This behavior is different from R5RS. In R5RS, an effect of such expression is
unspecified. For example,
Petite Chez(R5RS): Prints "Error: attempt to reference undefined variable a."
Scheme48(R5RS): Prints "Error: LETREC variable used before its value has been
produced"
SCM(R5RS): Evaluate letrec as if letrec*.
Any comments very welcome. Thank you!
Original comment by y.fujita...@gmail.com
on 13 Sep 2008 at 3:28
Original issue reported on code.google.com by
narutoca...@gmail.com
on 10 Sep 2008 at 9:57