Re: [racket-users] macro guard question (ellipsis)

2019-06-18 Thread Sorawee Porncharoenwase
Also note that with syntax/parse, it becomes much easier: (require (for-syntax syntax/parse)) (define-syntax (foo stx) (syntax-parse stx [(_ (key:id val:id ...) ...) #'(quote (list ((quote key) (quote val) ...) ...))])) On Tue, Jun 18, 2019 at 8:56 PM Sorawee Porncharoenwase <

Re: [racket-users] macro guard question (ellipsis)

2019-06-18 Thread Sorawee Porncharoenwase
I’d write this. Not sure if there’s a better way. (define-syntax (foo stx) (syntax-case stx () [(_ (key val ...) ...) (andmap identifier? (syntax->list #'(key ... {~@ val ...} ...))) #'(quote (list ((quote key) (quote val) ...) ...))])) On Tue, Jun 18, 2019 at 8:11 PM Kevin

[racket-users] macro guard question (ellipsis)

2019-06-18 Thread Kevin Forchione
Hi guys, I’ve been trying to figure out the syntax for a guard when the pattern has ellipsis and you want to guard one of the variables. Here’s an uninteresting macro but it shows what I mean. #lang racket (define-syntax (foo stx) (syntax-case stx () [(_ (key val ...) ...) (and

[racket-users] Call for Participation: Summer BOB 2019 (August 21, Berlin)

2019-06-18 Thread Michael Sperber
Summer BOB 2019 Conference “What happens if we simply use what’s best?” August 21, 2019, Berlin