[Larceny-users] quote-like form
David Van Horn
dvanhorn at ccs.neu.edu
Sat Sep 19 12:47:41 EDT 2009
Felix Klock wrote:
> Can you make clearer which requirements you are trying to respect? I do
> not think you are referring to a requirement of R5RS, since it says that
> "implementations are permitted, though not required, to share structure
> between constants where appropriate."
I believe this language is to allow syntactically distinct but identical
quoted constants to potentially be eq?. For example,
(define (f) '(1 2 3))
(define (g) '(1 2 3))
It is allowed that (eq? (f) (g)).
On the other hand, (eq? (f) (f)) must return true since (f) evaluates to
the same syntactic occurrence of a quoted constant.
> E.g. do you also want your form to behave like the below two cases?
>
> Larceny v0.97 "Funny in the Head" (Aug 19 2009 04:24:46,
> precise:Posix:unified)
> larceny.heap, built on Wed Aug 19 04:26:48 EDT 2009
>
> > (define (g) (list '(x) '(x)))
>
> > (eq? (car (g)) (cadr (g)))
> #t
This is taking advantage of the possibility mentioned above.
I am interested in the requirement that anything which evaluates to the
same occurrence of a quoted pair is the same.
David
More information about the Larceny-users
mailing list