[racket-dev] syntax property duplication

From: John Clements (clements at brinckerhoff.org)
Date: Wed Sep 7 13:37:19 EDT 2011

On Sep 6, 2011, at 8:12 PM, Sam Tobin-Hochstadt wrote:

> On Tue, Sep 6, 2011 at 8:05 PM, John Clements <clements at brinckerhoff.org> wrote:
>> On Aug 18, 2011, at 5:32 AM, Sam Tobin-Hochstadt wrote:
>>> Yes, I understand why this happens.  As I see it, there are a few possibilities:
>>> 1. The expander should check for duplicates, in some fashion.
>>> 2. This idiom is problematic, in the case where `stx' is both the
>>> input and used for the syntax properties of the output.
>>> 3. Macros may freely duplicate syntax properties.
>>> All of these have drawbacks, but (3), which you are suggesting, means
>>> either that syntax properties can only be used to specify idempotent
>>> information or that the non-idempotent ones need to have some
>>> *explicit* means by which equal elements can be distinguished, which
>>> must be part of the API of that syntax property.
>>> If we think this is how syntax properties ought to work, then we
>>> should add something to the documentation making this clear, and we
>>> should recognize that it's a limitation.
>> Would syntax-property guards solve this problem?
> I don't really see how.  What are you thinking of?

A guard could keep track of duplicates.  Keep in mind that syntax-property guards are purely a figment of my imagination.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4624 bytes
Desc: not available
URL: <http://lists.racket-lang.org/dev/archive/attachments/20110907/67bd83f4/attachment.p7s>

Posted on the dev mailing list.