[racket-dev] Dotted syntax/parse patterns and scribble/eval

From: Ryan Culpepper (ryan at cs.utah.edu)
Date: Tue Sep 27 15:15:11 EDT 2011

On 09/23/2011 07:17 AM, Carl Eastlund wrote:
> On Wed, Sep 21, 2011 at 7:44 PM, Ryan Culpepper<ryan at cs.utah.edu>  wrote:
>> This particular bug only affects patterns of the form
>>   (<stuff>  . var:expr)
>> If you've seen pattern variables get non-syntax values in some other way,
>> please let me know! (BTW, by "pattern variable" I mean a name bound directly
>> in the pattern; "nested attributes" like var.value are allowed to contain
>> non-syntax values.)
> ...except for pattern variables nested under ellipses, which are bound
> to lists; or pattern variables bound under ~or patterns, or under
> ~optional without #:defaults, which may be bound to #false.  Right?
> And I assume by "pattern variable" you are excluding the ~bind action
> pattern, the #:attr pattern directive, and the #:defaults clause of
> ~optional, all of which may supply arbitrary values; presumably those
> are "attributes" but not "pattern variables" per se.

Yes, you're right. Other than those.

What I really meant was if you can use syntax-parse to make the 
expression #'x evaluate to something other than a syntax object, that's 
a bug. Nested attributes are checked when used in syntax templates; if 
they don't have syntax values, an error is raised. The checks are turned 
off for simple pattern variables (not involving ~or), though, and that's 
what I'm concerned about.


Posted on the dev mailing list.