Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Possible bug: Zsh function does not terminate when ${name:?word} fails



On Wed, Sep 14, 2016 at 6:20 PM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Sep 14,  1:21pm, Ronald Fischer wrote:
> } Subject: Re: Possible bug: Zsh function does not terminate when ${name:?wo
> }
> } > This seems to be a side effect of the reserved word handling, if you do
> } > disable -r local
> } > then it behaves as expected.
> }
> } I don't think this would be a good idea.
>
> I think this was being presented as a diagnostic tool, not as a work-
> around for real usage.

Disabling local as a reserved word does not disable the builtin, and
only reverts to the old behavior of not being able to specify arrays'
values on the parameter declaration line.

% a=${foo:?bar}; echo hello
zsh: foo: bar
% local a=${foo:?bar}; echo hello
zsh: foo: bar
hello
% \local a=${foo:?bar}; echo hello
zsh: foo: bar

(the backslash has the same effect of overriding the reserved word handling)

-- 
Mikael Magnusson



Messages sorted by: Reverse Date, Date, Thread, Author