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

Re: Question regarding FORMAT with ~:^ within ~:{

    Date: Mon, 9 Nov 87 18:53:10 PST
    From: R Dunbar Poor <edsel!r@labrea.stanford.edu>
	    (format nil "~:{~@?~:^...~}" '(("a") ("b")))
    MY CLAIM: It should return "a".
    CLtL page 406 states that:
       "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 ~:^."

Although I agree that a superficial reading of the above would lead
one to expect "a" to be returned, if one thinks about the intent of
the parenthetical
   (because in the standard case it tests for remaining arguments of
   the current step only)

one should agree that "a...b" will be returned.  In refering to ~^ as
the "standard case", which tests the arguments remaining in the
current argument sublist, this parenthetical implies that there is
an `other case', which tests `something else.'  The only `other case'
discussed is ~:^, which therefore must test `something else.'  I claim
that the parentheical makes no sense if we interpret ~:^ as testing
the same condition as ~^.  If they both test the same condition, why
have the parenthetical explanation?

If ~:^ doesn't test the same condition as ~^, then what does it test?
I claim that the only test that makes sense is for ~:^ to test the
only thing that affects the "entire iteration process:" the number of
sublists.  When there are no more sublists, "the entire iteration
process" is terminated.

Finally, It makes no sense for ~:^ to test the number of args
remaining in the current sublist, since this can be acheived by the
   (format nil "~:{~@?~#[~0:^~]...~}" '(("a") ("b")))

But it makes perfect sense for ~:^ to test the number of arglists


-- Nick