<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Aug 7, 2014, at 8:53 PM, Matthias Felleisen <<a href="mailto:matthias@ccs.neu.edu">matthias@ccs.neu.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br>Here are some examples: <br><br><blockquote type="cite"><blockquote type="cite">(equal? #'(lambda (x) x) #'(lambda (x) x))<br></blockquote>#f<br></blockquote></blockquote><div><br></div><div>For these the source locations would still be different.</div><br><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">(define so #'(lambda (x) x))<br>(equal? so so)<br></blockquote>#t<br></blockquote></blockquote><div><br></div><div>For these they are eq?.</div><div><br></div><div><br></div><div><br></div><div>Does equal? simply use eq? for syntax objects?</div><div>This example says probably, or am I still missing something?</div><div><div><font face="Courier New">(define stx #'(lambda (x) x))</font></div><div><font face="Courier New">(equal? stx (datum->syntax stx (syntax-e stx) stx stx stx))</font></div></div><div><br></div><blockquote type="cite">Are syntax objects mutable? If so, how would you define a function like eq? say syntax-eq? without using the built-in equality? <br><br>Are syntax objects immutable? Why should they be immutable? How does equal? work on such structures normally? <br></blockquote><div><br></div><div>I was under the impression that syntax objects were immutable, but I don’t really know.</div><div>And anyway, for mutable vectors, strings, byte-strings, and structs, equal? still checks each element. </div><br><blockquote type="cite">See HtDP on extensional and intensional equality. — Matthias<br></blockquote><div><br></div><div>Where? I have read a lot of HtDP, and looked at it again just now, but I don’t remember anything about this, and couldn’t find anything either. </div><div>In the BSL docs for eq? and eqv? it mentions extensional and intensional, but doesn’t explain anything. </div><div>In Realm of Racket there was a bit about that, but that doesn’t really tell me anything about syntax objects. </div><br><blockquote type="cite"><br>On Aug 7, 2014, at 5:58 PM, Alexander D. Knauth wrote:<br><br><blockquote type="cite">How does equal? determine whether two syntax objects are equal?<br><br>Does it simply use eq?, or does it check the syntax-e, lexical context, srcloc and properties? <br><br><br><br>____________________<br> Racket Users list:<br> <a href="http://lists.racket-lang.org/users">http://lists.racket-lang.org/users</a><br></blockquote><br></blockquote></div><br></body></html>