0
在Guile或使用SRFI-46时,可能会出现如Specifying a Custom Ellipsis Identifier所示。但是在SISC或“纯方案”R5RS中可能吗?如何创建一个在SISC/Scheme中生成另一个宏的宏?
我知道这是可能的,但不使用省略号,但如果我需要使用像省略号这样的内部省略号?
(define-syntax define-quotation-macros
(syntax-rules()
((_ (macro-name head-symbol) ...)
(begin (define-syntax macro-name
(syntax-rules :::()
((_ x :::)
(quote (head-symbol x :::)))))
...))))
(define-quotation-macros (quote-a a) (quote-b b) (quote-c c))
(quote-a 1 2 3) ⇒ (a 1 2 3)