Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: break/continue vs. try-always



On Thu, 05 Jun 2014 08:53:19 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Jun 4, 10:37pm, Bart Schaefer wrote:
> } Subject: [PATCH] Re: Oddball output from zerrmsg()
> }
> } ... the "continue" propagates
> } up through the dynamic scopes and restarts the "while true;" loop ...
> } 
> } Not even an "always" block can intercept this, which is probably a bug in
> } the handling of "always".
> 
> OK, not a bug, exactly.  The always-block is in fact executed, but it has
> no way to decrement the number of levels of "break" or "continue" that
> have been set by the try-block.  It can *increase* the number of levels,
> but not stop the break/continue from propagating upward.

We could do something like add "break -r" to reset.  It would only be
usable in always blocks (not sure about traps) because otherwise you
don't get the chance to execute it.

pws



Messages sorted by: Reverse Date, Date, Thread, Author