From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26656 invoked from network); 4 Oct 2005 17:34:43 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 4 Oct 2005 17:34:43 -0000 Received: (qmail 71023 invoked from network); 4 Oct 2005 17:34:37 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 4 Oct 2005 17:34:37 -0000 Received: (qmail 12343 invoked by alias); 4 Oct 2005 17:34:34 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21838 Received: (qmail 12334 invoked from network); 4 Oct 2005 17:34:34 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 4 Oct 2005 17:34:34 -0000 Received: (qmail 70746 invoked from network); 4 Oct 2005 17:34:34 -0000 Received: from cluster-c.mailcontrol.com (HELO rly27c.srv.mailcontrol.com) (168.143.177.190) by a.mx.sunsite.dk with SMTP; 4 Oct 2005 17:34:31 -0000 Received: from exchange03.csr.com (mailhost1.csr.com [81.105.217.43]) by rly27c.srv.mailcontrol.com (MailControl) with ESMTP id j94HYU7O013281 for ; Tue, 4 Oct 2005 18:34:30 +0100 Received: from csr.com ([10.103.143.38]) by exchange03.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Tue, 4 Oct 2005 18:36:26 +0100 To: zsh-workers@sunsite.dk Subject: Re: Exception handling and "trap" vs. TRAPNAL() In-reply-to: <20051004172910.GA21195@DervishD> References: <20051001202856.GA134@DervishD> <1051002044052.ZM28373@candle.brasslantern.com> <20051002190940.437F9866F@pwstephenson.fsnet.co.uk> <1051002195518.ZM2163@candle.brasslantern.com> <20051002230027.GA194@DervishD> <1051003013758.ZM3107@candle.brasslantern.com> <20051003090121.GC278@DervishD> <1051003162109.ZM4533@candle.brasslantern.com> <20051003175913.GB3231@DervishD> <1051004163144.ZM32294@candle.brasslantern.com> <20051004172910.GA21195@DervishD> Comments: In-reply-to DervishD message dated "Tue, 04 Oct 2005 19:29:10 +0200." Date: Tue, 04 Oct 2005 18:34:29 +0100 From: Peter Stephenson Message-ID: X-OriginalArrivalTime: 04 Oct 2005 17:36:26.0886 (UTC) FILETIME=[25ACBA60:01C5C90A] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-05-40-00 (www.mailcontrol.com) on 10.67.0.137 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.4 DervishD wrote: > Just one note: why should be always blocks needed at all if you > can use this kind of solutions? As long as you don't cause ZERR to be > raised in "common_error()", this solution is much better because you > can fine tune (using the "trap" builtin) when do you want to do > common handling and when you don't. The only difference I can see is > that code in an always block is executed in the current environment > and code in "common_error()" is not. TRAP_RETURN triggers on any non-zero status, while an "always" block is used to stop actual errors which would usually cause everything in sight(*) to abort. If you're really concerned only with non-zero status and don't care about errors there's every reason to go with something like TRAP_RETURN. (*) for some values of "everything" pws This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com