(For now please ignore that what I'm after is un-Schemey, because this for a DSL aimed at non-programmers)
I'd like to do something eqivalent to this:
(pairwise key1 value1 key2 value2)
Which would expand to this, m
being another macro I've defined (hence I can't simply use a variadic style function):
(list (cons key1 (m value1)) (cons key2 (m value2)))
I've tried this:
(define-syntax pairwise
(syntax-rules ()
((_ key value ...)
(list (cons key (m value)) ...))))
But as I guessed it expanded to:
(list (cons key1 (m value1)) (cons key1 (m key2)) (cons key1 (m value2)))
I'm a bit stuck on how to process these elements pairwise in the way I'd like, without requiring a user to add inner brackets.