| ckimyt@gmail.com 2005-02-12, 3:57 am |
| I couldn't find a reference to this particular example as an error, so
either no one noticed it, no one cares, or I'm wrong.
=)
If the latter, could someone please tell me why?
Section 4.2.6 on quasiquotation states (page 13 of the PDF, bottom of
the left column):
"Quasiquote forms may be nested. Substitutions are made
only for unquoted components appearing at the same nesting
level as the outermost backquote. The nesting level increases
by one inside each successive quasiquotation, and
decreases by one inside each unquotation."
Then the example is given (top right column of page 13):
`(a `(b ,(+ 1 2) ,(foo ,(+ 1 3) d) e) f)
=> (a `(b ,(+ 1 2) ,(foo 4 d) e) f)
I think this is wrong. Why is ,(+ 1 3) evaluated? It's clearly at the
`(b ...) level of quasiquotation. I think the example should read:
`(a `(b ,(+ 1 2) ,(foo ,(+ 1 3) d) e) f)
=> (a `(b ,(+ 1 2) ,(foo ,(+ 1 3) d) e) f)
because there are no (unquote ...) or (unquote-splicing ...) constructs
at the `(a ...) level of quasiquotation.
Anyone?
Thanks...
|