(define-syntax func-with-pairs
(lambda (stx)
(syntax-case stx ()
((_ fn . rest)
(odd? (length (syntax-object->datum #'rest)))
(error "func-with-pairs must have an even number of
arguments"))
((_ fn . rest)
(with-syntax ((conses (make-pair-list #'rest)))
(syntax
(fn . conses)))))))
;; Kawa doesn't have define-for-syntax; just use define
(define-for-syntax (make-pair-list stx)
(syntax-case stx ()
(()
(syntax ()))
((a b . rest)
(with-syntax ((rest-conses (make-pair-list #'rest)))
(syntax
((cons a b) . rest-conses))))))