[Larceny-users] quote-like form

Felix Klock felixluser at pnkfx.org
Sat Sep 19 12:37:48 EDT 2009


On Sep 19, 2009, at 10:00 AM, David Van Horn wrote:

> Suppose I define a cons-like structure and I want to provide a form  
> that
> is like quote, but produces my cons-like things when it quotes  
> syntactic
> pairs.  In particular, I need the form to respect the eq?-ness
> requirements on quoted pairs, so that:
>
>    (define (f) '(x))
>    (eq? (f) (f))     => #t
>

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."

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

   > (define (h) '((x) (x)))

   > (eq? (car (h)) (cadr (h)))
   #f


-Felix





More information about the Larceny-users mailing list