[R6RS] Bawden quasiquote extension

Michael Sperber sperber at informatik.uni-tuebingen.de
Fri Jun 23 02:26:19 EDT 2006

dyb at cs.indiana.edu writes:

> The syntax-case reference implementation implements the nested quasiquote
> extensions and it does what you say (and I agree) the R5RS mandates.
>   > (let ([q '((union x y) (list 'sqrt 9))])
>       ``(foo ,, at q))
>   `(foo (unquote (union x y) (list 'sqrt 9)))
> The output would be invalid syntax, as you say, in R5RS and Common Lisp,
> but not with Bawden's quasiquote extensions.

Just to be clear, you're proposing that

(unquote <exp> ...)

gets a list of the values of <exp> ... plugged into the quasiquote
from, right?

I guess that's fine, but it does look a bit strange in that the list
construction with unquote suddenly gets introduced by moving from 1 to
n>1 arguments.  I think I would prefer if the unquote were duplicated.

I'm not sure how that relates to "Bawden's quasiquote extensions," as
Alan's expander assumes that there's only one operand to unquote:

(qq-expand '`(foo (unquote (union x y) (list 'sqrt 9))))
(append '(append) (append (list (append '(quote) (append (list (append '(foo) '())) '()))) (append (list (append '(append) (append (list (append '(list) (append (list (append '(union) (append '(x) (append '(y) '())))) '()))) (append (list (append '(quote) (append '(()) '()))) '())))) '())))

(The (sqrt 9) disappears.)

Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla

More information about the R6RS mailing list