* In section 3.6, the paragraph describing ellipses says, "otherwise,
the expander would not be able to determine how many times the
subform
should be repeated in the output." I've never understood precisely
how Scheme macro systems decide how many expansions to do for a
particular use of ellipses in the output template. I can usually
intuit what will happen, but I've never had a concrete understanding
of the algorithm. Would it be possible to expand on the algorithm
here to make it absolutely clear?
Probably. I've made a note to try to do this at some point.
Both k and e2 are directly followed by an ellipsis, and the pattern
containing the two of them is also followed by an ellipsis. So
both must
be followed by at least two ellipses in the output. They are. k
and e2
are each directly followed by an ellipsis in the template, and the
template containing both is also followed by an ellipsis, the one
you've
marked. If you think about each ellipsis as a mapping operation, the
marked ellipsis maps a procedure that constructs one cond clause
over a
list of a list of k's, a list of e1's and a list of a list of
e2's. The
ellipsis following k in the template maps the identity function
over the
list of k's---in other words, it simply returns the list of k's.
Actually, the call to make-variable-transformer should not appear, so
that the expander never passes a set! expression to the transformer
when
that form of identifier-syntax is used.