From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10068 invoked by alias); 23 Jan 2016 23:53:06 -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: 37749 Received: (qmail 14040 invoked from network); 23 Jan 2016 23:53:04 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,FAKE_REPLY_C autolearn=ham autolearn_force=no version=3.4.0 Date: Sat, 23 Jan 2016 23:53:00 +0000 From: Daniel Shahaf To: zsh-workers@zsh.org Cc: Eric Cook Subject: Re: [PATCH] typeset: set $? on incidental error Message-ID: <20160123235300.GC20278@tarsus.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160121142201.GD21104@cventin.lip.ens-lyon.fr> <569FA0FC.3030004@gmx.com> User-Agent: Mutt/1.5.23 (2014-03-12) Between all the replies I'm convinced that the builtin interface of 'local' shouldn't be changed: «builtin local x=$(false)» should set $? to 0. (I meant to say that in a previous email.) However, the question remains, in my eyes, whether the change should be made to the reserved word interface. The reserved word 'typeset' is not a command, but part of the shell's language, so in . typeset x=$(foo) y=$(bar) . the last command executed is 'bar'. I would expect that line to behave as similarly to . x=$(foo) y=$(bar) . as possible, so for example, I'd expect the former to set $? to the exit code of 'bar', as the latter statement does. Cheers, Daniel