[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Question regarding FORMAT with ~:^ within ~:{
I won't bother trying to quote your message here. Folks who missed it
should look in the archives.
The question is, what should this form return:
(format nil "~:{~@?~:^...~}" '(("a") ("b")))
Rob wants it to return "a" since ~:? means to terminate all iterations
now. Other people, including the implementors of the Symbolics FORMAT
facility, believe that it should be "a...b" since it is required to
check for the presence or absence of any further arguments to the outer
iteration.
I believe that Symbolics (and the other people) are right. Consider the
following: the quoted paragraph from CLtL page 406 says this:
"If ~^ is used within a ~:{ construct, then it merely terminates
the current iteration step (because in the standard case it tests
for remaining arguments of the current step only); the next
iteration step commences immediately. To terminate the entire
iteration process, use ~:^."
In the first sentence, the claim is that ~^ will unconditionally
terminate the current iteration step. But we know from context on the
page that this isn't true, that really it will terminate the step only
when no more arguments remain for that step. If we had wanted truly
unconditional termination, we should have used ~0^. Thus, by the same
context, the claim that ~:^ terminates the entire iteration must be
understood to mean that it does so only when there are no more arguments
for that iteration. If we had wanted the other meaning, we should have
used ~0:^.
Thus, I think that a truly strict interpretation of CLtL implies that
the other people (and Symbolics) are right.
Pavel