From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15436 invoked by alias); 6 Jun 2014 21:45:30 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 32730 Received: (qmail 20942 invoked from network); 6 Jun 2014 21:45:26 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-Originating-IP: [86.6.157.246] X-Spam: 0 X-Authority: v=2.1 cv=W7a2VHmk c=1 sm=1 tr=0 a=BvYiZ/UW0Fmn8Wufq9dPrg==:117 a=BvYiZ/UW0Fmn8Wufq9dPrg==:17 a=NLZqzBF-AAAA:8 a=LGXc4NIGxrIA:10 a=uObrxnre4hsA:10 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=iTZxnBlC4VLfF7Mpht4A:9 a=CjuIK1q_8ugA:10 a=I6wTmPyJxzYA:10 a=_dQi-Dcv4p4A:10 Date: Fri, 6 Jun 2014 22:45:23 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: break/continue vs. try-always Message-ID: <20140606224523.09d5f22c@pws-pc.ntlworld.com> In-Reply-To: References: <140603191227.ZM28198@torch.brasslantern.com> <140604223723.ZM22960@torch.brasslantern.com> <140605085319.ZM4272@torch.brasslantern.com> <20140606215853.0c6ecae9@pws-pc.ntlworld.com> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 6 Jun 2014 14:08:53 -0700 Bart Schaefer wrote: > On Jun 6, 2014 2:04 PM, "Peter Stephenson" > wrote: > > > > 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. > > I was thinking perhaps "break 0" which is otherwise/currently an error. > Assuming the break handler can tell when it is in the scope of an always > block. That's straightforward --- well, it isn't, but it's straightforward to make it only work in always blocks and ignore it elsewhere which is probably good enough since this is rather a specialised feature --- but it occurred to me that for a complete sandbox it would be useful to have "continue -r" and "return -r". "continue 0" works but obviously "return 0" doesn't do that. Actually, break -r (or break 0) would have a side effect on continue because of the interaction between the "breaks" and "contflag" variables, so arguably break -r and continue -r shouldn't be independent however it's implemented. pws