* (format nil "~@{- ~a~^ |~} _________________" 'a 'b "ewr")
I thought I would get
"- A _________________"
but I got instead
"- A |- B |- ewr _________________"
So the ~^ stops the iteration only after all items have been processed ;
before that it doesn't have any effect. Have I got it right ? Is there
an omission in the HS ?
--
Is a computer without its case on cyberporn ?
> In 22.3.7.4 it says "Finally, the ~^ directive can be used to terminate
> the iteration prematurely". When I read that I thought that when ~^ is
> encountered the iteration stops. But this isn't how it works. For
> example:
>
> * (format nil "~@{- ~a~^ |~} _________________" 'a 'b "ewr")
>
> I thought I would get
>
> "- A _________________"
>
> but I got instead
>
> "- A |- B |- ewr _________________"
>
> So the ~^ stops the iteration only after all items have been processed ;
> before that it doesn't have any effect. Have I got it right ?
Yes.
> Is there an omission in the HS ?
No. See section "22.3.9.2 Tilde Circumflex: Escape Upward" for details about ~^.
--
__Pascal Bourguignon__
Yeah, it does, but you need the deets in 22.3.9.2 to disambiguate:
"This is an escape construct. /If there are no more arguments remaining
to be processed/, then the immediately enclosing ~{ or ~< construct is
terminated."
Emphasis added. So the prematurity is not terminating processing of the
list, it is the inclusion of other stuff between the tilde braces
(following the tilde circumflex).
kt