[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

quasiquote



Matthias Blume writes:

> Sorry for this question since it might appear stupid.  I never managed
> to understand the reasons for the way quasiquote is defined.  What I
> mean are the nesting levels.  Could someone give a rationale for them,
> please?  Are there any historical or other reasons for the current
> interpretation?

Someone else who knows the history might comment, but the reason I see
for nesting levels is to permit substitution to work properly.  Ie,

  (define e '`(a ,b))
  `(1 ,e)

is equivalent to:

  `(1 `(a ,b))

What I don't like is the sentence on page 12 of R4RS:

``Unpredictable behavior can result if any of the symbols quasiquote,
unquote, or unquote-splicing appear in positions within a <template>
otherwise than as described above.''

Consequently, Chez Scheme rejects:

   `(quasiquote 1 2)

with an error, while MIT Scheme accepts it.  This is probably an old
battle, but I would like to see R5RS clean this up.

Andrew Wright