[racket] matching optional keyword + value

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Fri Apr 27 08:38:59 EDT 2012

On Fri, Apr 27, 2012 at 8:32 AM, Laurent <laurent.orseau at gmail.com> wrote:
>> If you're processing the contents of a `defform' call, probably the
>> right thing to do is just just use `syntax-parse' -- it's great for
>> this sort of thing.
>
>
> Actually, the defforms are read directly from a scribble file, so it's not a
> call.
> Is it possible to have syntax-parse deal directly with values instead of
> syntax objects?
> (I suppose I could turn the read list into a syntax object, but that's
> probably not the best way to do it, is it?)

If you're processing user input, it might have errors, in which case
you'll probably want source locations.  So I would just use
`read-syntax' instead of `read', and process with `syntax-parse'.

-- 
sam th
samth at ccs.neu.edu

Posted on the users mailing list.