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 <
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
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
Summer BOB 2019
Conference
“What happens if we simply use what’s best?”
August 21, 2019, Berlin
4 matches
Mail list logo