Email list hosting service & mailing list manager

Distinct fields Andre van Tonder (03 Jan 2006 19:28 UTC)
Re: Distinct fields Michael Sperber (05 Jan 2006 18:36 UTC)

Distinct fields Andre van Tonder 03 Jan 2006 19:28 UTC

The issues section states:

"Macros that expand into the implicit-naming layer might have unexpected
behavior, as field names that are distinct as identifiers may not be distinct
as symbols, which is how they're used."
^^^^^^^^^^

Is the concept of distinctness defined with respect to symbolic equivalence?

It is not obvious to me that this should be the case.
In the context of syntax-case, my first thought was that perhaps
free-identifier=? might be a more appropriate predicate for
distinctness, but then the following occurred to me:

(define-syntax foo
   (syntax-rules ()
     ((_ f)
      (define-record-type p
        (fields (mutable x)       ; - would make a secret p-x
                (mutable f))))))  ; - would make a toplevel p-x
                                  ;   when called as below

(foo x)

In implementations of syntax-case that treat defines on
macro-generated identifiers as establishing "secret" bindings
(such as Chez and PLT), the p-x bindings for the two fields would
be distinct, and not interfere, even though they are
free-identifier=?  So the example would probably work.

Regards
Andre