From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh-workers@zsh.org
Subject: Re: Inconsistency of GLOB_ASSIGN
Date: Fri, 28 Nov 2014 09:34:20 +0000 [thread overview]
Message-ID: <20141128093420.4fbeab70@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <141127150036.ZM5089@torch.brasslantern.com>
On Thu, 27 Nov 2014 15:00:36 -0800
Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Nov 27, 1:38pm, Bart Schaefer wrote:
> }
> } On Nov 27, 8:43pm, Peter Stephenson wrote:
> } }
> } } It would be neater always to do an array assignment, in fact, but
> } } the traditional behaviour is that if there was only one result the
> } } assignment is scalar
> }
> } That's too bad, because making it always be an array assignment is a
> } lot simpler than figuring out whether the glob expanded to something.
>
> So in actuality, not too much different. Below are two patches, pick
> one ... both need the haswilds() test to preserve the behavior of
> assigning a non-glob-string-that-looks-like-math to an integer/float.
Given there not much difference, it would probably be better to stick
with the one that does scalar assignment in the case of a single entry.
I've no idea if anyone is still using GLOB_ASSIGN, but they're not
likely to be complaining about efficiency, and if they always want an
array assignment there's an easy way of getting that.
pws
next prev parent reply other threads:[~2014-11-28 9:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-27 5:57 Bart Schaefer
2014-11-27 20:43 ` Peter Stephenson
2014-11-27 20:51 ` Bart Schaefer
2014-11-27 21:38 ` Bart Schaefer
2014-11-27 23:00 ` Bart Schaefer
2014-11-28 9:34 ` Peter Stephenson [this message]
2014-11-28 18:39 ` Bart Schaefer
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=20141128093420.4fbeab70@pwslap01u.europe.root.pri \
--to=p.stephenson@samsung.com \
--cc=zsh-workers@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).