From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19985 invoked by alias); 12 Mar 2014 17:55:37 -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: 32478 Received: (qmail 10399 invoked from network); 12 Mar 2014 17:55:31 -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, SPF_HELO_PASS autolearn=ham version=3.3.2 Message-ID: <53209E1E.2090007@case.edu> Date: Wed, 12 Mar 2014 13:49:18 -0400 From: Chet Ramey Reply-To: chet.ramey@case.edu User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: Peter Stephenson , zsh-workers@zsh.org CC: chet.ramey@case.edu, "Eduardo A. Bustamante Lopez" Subject: Re: Zsh does not follow POSIX when return is called during the action of a trap References: <20140312153627.GA15209@dualbus.me> <140312095210.ZM13090@torch.brasslantern.com> <20140312170309.48ea7444@pwslap01u.europe.root.pri> In-Reply-To: <20140312170309.48ea7444@pwslap01u.europe.root.pri> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Junkmail-Status: score=10/50, host=mpv6.cwru.edu X-Junkmail-Whitelist: YES (by domain whitelist at mpv2.tis.cwru.edu) On 3/12/14 1:03 PM, Peter Stephenson wrote: > However, I'm trying to work out what happens with the case > > | trap '(exit BEFORE-RETURN); return EXPLICIT-RETURN-VALUE' SIGNAL > | > | fn() { > | (exit BEFORE-ACTION); -block here waiting for signal- > | } > > Should this exit with EXPLICIT-RETURN_VALUE or BEFORE-ACTION? The > latter is easier to implement but my guess (without ploughing through > the standard) is EXPLICIT-RETURN-VALUE is right here. The correct exit value is EXPLICIT-RETURN-VALUE. The standards text that Eduardo quoted only applies to the case where `return' is not given an argument. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/