Reputation: 6152
how can I match a list in syntax parse? I tried this code:
(syntax-parse #'(1 2)
[(list a b) (printf "a: ~a~n") #'a])
but doesn't seem to work. I'm assuming '(1 2)
is a list in racket?
Upvotes: 1
Views: 112
Reputation: 31147
The pattern syntax of syntax-parse
and match
are different.
Try:
(syntax-parse #'(1 2)
[(a b) (printf "a: ~a~n" #'a)])
Upvotes: 1