| From: Felix <pfr6rs_at_pnkfx.org>
| Date: Sat, 7 Oct 2006 20:07:01 -0400
|
| On Oct 7, 2006, at 4:23 PM, Aubrey Jaffer wrote:
|
| > It is my understanding that LETREC* semantics can replace LETREC
| > semantics in an R5RS implementation without breaking any behavior
| > guaranteed by R5RS.
|
| This understanding may be incorrect. Al Petrofsky has an
| expression that can observe the difference between R5RS letrec and
| the common implementation of letrec as letrec* (by using, surprise
| surprise, call/cc). See the following thread:
|
|
http://groups.google.com/group/comp.lang.scheme/tree/browse_frm/thread/141d47814c79776b/b646336450487157?rnum=1&q=Widespread+bug+(arguably)+in+letrec+when+an+initializer+returns+twice&_done=%2Fgroup%2Fcomp.lang.scheme%2Fbrowse_frm%2Fthread%2F141d47814c79776b%2F93641d7d47af2858%3Flnk%3Dst%26q%3DWidespread+bug+(arguably)+in+letrec+when+an+initializer+returns+twice%26rnum%3D1%26#doc_93641d7d47af2858
Cute! But then internal defines in R6RS will not be backward
compatible with R5RS. The following code detects the difference
between LETREC and LETREC* semantics for internal defines:
(let ()
(define x (call-with-current-continuation list))
(define y (call-with-current-continuation list))
(cond ((procedure? x) (x (pair? y)))
((procedure? y) (y (pair? x))))
(let ((x (car x)) (y (car y)))
(and (call-with-current-continuation x)
(call-with-current-continuation y)
(call-with-current-continuation x))))
Given this incompatibility, what is the justification for retaining
LETREC in R6RS?
Note: xpdf can't search for "defin" in r6rs_91.pdf because the "fi"s
are coded as "?" (#\x4F421).
Received on Sat Oct 07 2006 - 23:06:29 UTC