【发布时间】:2014-07-06 06:17:32
【问题描述】:
在 Guile 或使用 SRFI-46 中,可以像 Specifying a Custom Ellipsis Identifier 中所示。但在 SISC 或“纯方案”R5RS 中是否可行?
我知道不使用省略号也是可能的,但是如果我需要像下面的示例那样使用内部省略号怎么办?
(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)
【问题讨论】:
标签: macros scheme r5rs guile srfi