Identifier equality of identifiers stashed in preserved syntax properties

Alexis King <[email protected]>
Newsgroups gmane.comp.lang.racket.user,gmane.lisp.scheme.plt
Message-ID <[email protected]>
In the language I am working on, I store identifiers in preserved
syntax properties to attach type information to pieces of syntax.
More specifically, I store identifiers inside prefab structs, which
are then stored within preserved syntax properties. This seems to
work fine when my program spans a single module, but it breaks in
a confusing way when I use an identifier from another module.

Specifically, I have two identifiers from the “same” place, but the
macro that attaches the syntax property is used in two different
modules. I would expect these identifiers to be free-identifier=?,
but they are not. Looking at what identifier-binding returns, I get
the following results:

  (#<module-path-index:()> List #<module-path-index:()> List 0 0 0)
  (#<module-path-index:(rascal/prelude)> List #<module-path-index:(rascal/prelude)> List 0 0 0)

Obviously, the module path index values are different, but I don’t
know why or how to fix it. My attempt to create a minimal reproducible
test case led to me filing racket/racket#1495[1], but that issue
seems to be slightly different from my problem.

If I stick an identifier in a preserved syntax property, what are
the guarantees I have about it? Is using free-identifier=? on it
from another module dangerous in some way? The documentation doesn’t
seem to mention anything about this, but in the meantime, I’m
honestly a little unsure how to even begin to fix this (aside from
radically changing how my program works).

[1]: https://github.com/racket/racket/issues/1495

-- 
You received this message because you are subscribed to the Google Groups "Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
For more options, visit https://groups.google.com/d/optout.
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.