On 9/28/16 12:04 PM, William J. Bowman wrote:
On Fri, Sep 23, 2016 at 02:58:23PM -0400, Ryan Culpepper wrote:
It appears that the constructor macro (implemented by self-ctor-transformer
in racket/private/define-struct.rkt) transfers the syntax properties from
the macro use to its expansion (see the datum->syntax in the first
syntax-case clause). Then the properties get duplicated because of the
merging step described here:
http://docs.racket-lang.org/reference/stxprops.html.

Ah, I totally missed the description of merging.
I thought there might be some merging logic, but didn't see it
described under `syntax-property`.

So should all uses of syntax properties expect to sometimes get cons
pairs of merged properties?

For terms that occur in expansion contexts, yes---potentially, at least. I think that the kind of duplication that the constructor does should be considered a bug; each occurrence of a syntax property should have a reason for appearing. Then you could reason, for example, that if only one macro sets a particular property and it isn't recursive then merging won't occur for that property.

Unfortunately, there are probably many such buggy macros, since I don't think most people have a clear idea when to copy properties when using datum->syntax.

Ryan

--
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to