[racket] how does equal? determine with syntax objects?

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Thu Aug 7 20:53:46 EDT 2014

Here are some examples: 

> > (equal? #'(lambda (x) x) #'(lambda (x) x))
> #f
> > (define so #'(lambda (x) x))
> > (equal? so so)
> #t

Are syntax objects mutable? If so, how would you define a function like eq? say syntax-eq? without using the built-in equality? 

Are syntax objects immutable? Why should they be immutable? How does equal? work on such structures normally? 

See HtDP on extensional and intensional equality. -- Matthias






On Aug 7, 2014, at 5:58 PM, Alexander D. Knauth wrote:

> How does equal? determine whether two syntax objects are equal?
> 
> Does it simply use eq?, or does it check the syntax-e, lexical context, srcloc and properties?  
> 
> 
> 
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/users



Posted on the users mailing list.