[racket] syntax-parse questions

From: Eric Tanter (etanter at dcc.uchile.cl)
Date: Tue Apr 12 19:00:56 EDT 2011

On Apr 12, 2011, at 5:38 PM, Ryan Culpepper wrote:
> There are two kinds of ~optional: one is for head patterns and the other is for ellipsis-head patterns. The #:name keyword is only allowed in the latter case.

ok, makes sense. 

> Ah, sorry, the docs are incomplete for #:defaults; I'll fix that. If the ellipsis depth is not 0 (for example, 'key' has a depth of 1), you must specify the depth too. I think this is what you want: [...]

Yes, that does the job perfectly!

> I wish I'd made #:defaults take patterns on the left-hand sides instead.

Indeed, that's the first thing I tried! (conversely, I would never have guessed the current syntax)

> I'll see if I can add something like that before the upcoming release.

that'd be great,

> Hope that helps,

it does, thanks a lot.

-- Éric

Posted on the users mailing list.