unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: Damien Mattei <damien.mattei@gmail.com>, guile-user <guile-user@gnu.org>
Subject: RE: equality of syntax objects
Date: Thu, 23 May 2024 00:12:02 +0200	[thread overview]
Message-ID: <20240523001202.SNC02C00D1JCEDt06NC2dD@albert.telenet-ops.be> (raw)
In-Reply-To: <CADEOadcU1j_CPmebbeJtc5+sM-P5fBAPLM8dTMtc1nc1J3ZmPg@mail.gmail.com>

>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


  parent reply	other threads:[~2024-05-22 22:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-20 11:42 equality of syntax objects Damien Mattei
2024-05-20 14:53 ` Damien Mattei
2024-05-20 21:21   ` Damien Mattei
2024-05-22 22:12   ` Maxime Devos [this message]
2024-05-23 13:55     ` Damien Mattei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240523001202.SNC02C00D1JCEDt06NC2dD@albert.telenet-ops.be \
    --to=maximedevos@telenet.be \
    --cc=damien.mattei@gmail.com \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).