From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11739 invoked from network); 6 Aug 2008 17:54:53 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 6 Aug 2008 17:54:53 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 10424 invoked from network); 6 Aug 2008 17:54:44 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 6 Aug 2008 17:54:44 -0000 Received: (qmail 3812 invoked by alias); 6 Aug 2008 17:54:34 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25407 Received: (qmail 3792 invoked from network); 6 Aug 2008 17:54:31 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 6 Aug 2008 17:54:31 -0000 Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [217.69.20.190]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 80031805A433 for ; Wed, 6 Aug 2008 19:54:28 +0200 (CEST) Received: from cameurexb01.EUROPE.ROOT.PRI ([193.128.72.68]) by rly29d.srv.mailcontrol.com (MailControl) with ESMTP id m76HsRlJ000829 for ; Wed, 6 Aug 2008 18:54:27 +0100 Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Wed, 6 Aug 2008 18:54:25 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.14.2/8.13.4) with ESMTP id m76HsPsm002661 for ; Wed, 6 Aug 2008 18:54:25 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.14.2/8.14.2/Submit) with ESMTP id m76HsOQv002657 for ; Wed, 6 Aug 2008 18:54:25 +0100 Message-Id: <200808061754.m76HsOQv002657@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: "Zsh hackers list" Subject: Re: PATCH: skip command from debug trap In-reply-to: <6cd6de210808061000l5c6e0a8fheb06db75560a1598@mail.gmail.com> References: <27237.1217946438@csr.com> <6cd6de210808051647k17f14902nce840ca3edd6ddb@mail.gmail.com> <20080806104716.44647a75@news01> <6cd6de210808061000l5c6e0a8fheb06db75560a1598@mail.gmail.com> Comments: In-reply-to "Rocky Bernstein" message dated "Wed, 06 Aug 2008 13:00:28 -0400." Date: Wed, 06 Aug 2008 18:54:24 +0100 From: Peter Stephenson X-OriginalArrivalTime: 06 Aug 2008 17:54:25.0508 (UTC) FILETIME=[76F42240:01C8F7ED] X-Scanned-By: MailControl A-08-50-03 (www.mailcontrol.com) on 10.68.0.139 X-Virus-Scanned: ClamAV 0.92.1/7959/Wed Aug 6 15:06:37 2008 on bifrost X-Virus-Status: Clean "Rocky Bernstein" wrote: > Others have noted the challenges in adding an option to return. Making > the semantics of the return statement already more complicated doesn't > seem wise. However, as I've pointed out I can guarantee to make that compatible with the current shell, and at the same time make return work as in other shells (apart from the math eval of the numeric argument, which would cause an error in other shells anyway) which it doesn't at the moment. Once we have the latter adding an option is trivial. Adding an option to a builtin is about the simplest thing it's possible to do. > A couple other approaches are setting a variable or calling a routine. > For example "trap_return --skip" or TRAP_RETURN="skip" On the other hand, I can't make this compatible with existing versions (the standard namespace pollution problem). I don't like adding a new builtin just for this. The variable version is doable, we've done similar things before. You'd have to note that it didn't force return from the current environment, either the inline trap or TRAPDEBUG. You'd also have to be prepared for the shell to manipulate the variable behind your back, else you'd run into problems with having it set on future traps. It's not disastrous, but I'm not convinced this is simpler. In fact, at the moment it seems to me manifestly much more complicated. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070