Subject: Re: [PATCH] typeset: set $? on incidental error
From: Daniel Shahaf <[email-masked]>
To: [email-masked]
Cc: Eric Cook <[email-masked]>
Date: Sat, 23 Jan 2016 23:53:00 +0000
List-Id: Zsh Workers List <zsh-workers.zsh.org>

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