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)