[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
No Subject
I have a question about Scheme about which I am unclear after reading
R3RS. Consider the following procedure definitions
(define foo
(lambda () '(x y z)))
(define baz
(lambda () `(x y z)))
(define grump
(lambda (k) `(x y z ,k)))
Are the following expressions true, false, or implementation-dependent?
1: (eq? (foo) (foo))
2: (eq? (baz) (baz))
3: (eq? (grump 'w) (grump 'w))
It is hard to imagine that implementation would require 1 to be false or
3 to be true. But I could imagine, for example implementations being
allowed to transform:
'(x y z)
into
(list 'x 'y 'z)
thereby creating a distinct list each time the expression is evaluated.
Steve Vegdahl
Computer Research Lab
Tektronix Labs
Beaverton, Oregon