zsh-users
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh Mailing-List <zsh-users@zsh.org>
Subject: Re: Possible bug: Zsh function does not terminate when ${name:?word} fails
Date: Wed, 14 Sep 2016 21:08:29 +0200	[thread overview]
Message-ID: <CAHYJk3T+dquCAudmAjN_7GZKBqmanRf=8WKLDme_OzdVEBpHZg@mail.gmail.com> (raw)
In-Reply-To: <160914092059.ZM29649@torch.brasslantern.com>

On Wed, Sep 14, 2016 at 6:20 PM, Bart Schaefer
<schaefer@brasslantern.com> 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


  reply	other threads:[~2016-09-14 19:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20160914080154eucas1p11c49e4dd5f0d45f92deaef1ce08099de@eucas1p1.samsung.com>
2016-09-14  8:00 ` Ronald Fischer
2016-09-14  8:19   ` Mikael Magnusson
2016-09-14 11:21     ` Ronald Fischer
2016-09-14 16:20       ` Bart Schaefer
2016-09-14 19:08         ` Mikael Magnusson [this message]
2016-09-14  9:19   ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHYJk3T+dquCAudmAjN_7GZKBqmanRf=8WKLDme_OzdVEBpHZg@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).