RE: equality of syntax objects

Maxime Devos <[email protected]>
Newsgroups gmane.lisp.guile.user
Message-ID <[email protected]>
>asked more simply:

>how to know ,for two syntax objects now different but that represents two
different procedures created with the same name at two different moment,how
to know that the names are still the same?

>i see two solutions:
-parse the representation string to know for example expt that expt is in
both string:
"#<syntax:unknown file:2:7 expt>"
"#<syntax:operation-redux.scm:88:12 expt>"
not really pretty but will work.I test it in Racket and kawa too...

It appears you want to know equality as _symbols_, instead of equality of _identifiers_.

>    (and (identifier? obj1) ;(syntax? obj1)
>             (identifier? obj2) ;(syntax? obj2)
>             (free-identifier=? obj1 obj2)))

So, instead of checking identifiers with free-identifier=?, instead try ‘syntax->datum’ to extract the name (with lexical information removed) + ‘eq?’ (to compare two symbols).

Best regards,
Maxime Devos
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.