From: Zoltan Hidvegi <hzoli@cs.elte.hu>
To: A.Main@dcs.warwick.ac.uk (Zefram)
Cc: huyle@arachno.ugcs.caltech.edu, zsh-workers@math.gatech.edu
Subject: Re: zsh3.0.0 bug: $=a split
Date: Wed, 21 Aug 1996 20:35:15 +0200 (MET DST) [thread overview]
Message-ID: <199608211835.UAA08558@bolyai.cs.elte.hu> (raw)
In-Reply-To: <19648.199608162352@stone.dcs.warwick.ac.uk> from Zefram at "Aug 17, 96 00:52:23 am"
[I'm back earlier than I promised but do not expect too much from me in the
next two days... :-) ]
Zefram wrote:
> >Now, I need the parentheses or need to declare i as an array, but
> >before i would automatically be set to an array:
>
> That's mentioned about two pages down Etc/NEWS, but in the context of
> globbing. Globbing in assignments can be turned on with GLOB_ASSIGN,
> but there's no option to do field splitting to generate an array.
> You'll just have to use parentheses, which works with older zsh
> versions anyway.
>
> Zoltan: should GLOB_ASSIGN be extended to generate arrays based on
> field splitting too? Or do we now want to remove this option
> entirely?
I do not like GLOB_ASSIGN and I really feel that it should be completely
removed. Zsh-2.5.0 handled such situations much worse than 3.0.0. If foo
was an array with zero or one elements, after a
foo=$foo
assignment it changed to a scalar. Otherwise it remaned an array. After
foo=*
foo was array if * expanded to more than 1 files otherwise foo become a
scalar. That piece of code which did that also caused `ambiguous' error
message from zsh in some other situations (I could not tell now any but
that may happen every time singsubst() is called).
In an assignment,
foo=$bar
it may seem to be logical for foo to become an array if bar is an array but
what should happen if I write foo=/$bar? Internally the RHS is evaluated
and after that it is not possible to tell if the result came from an array
expansion or word splitting or globbing etc. glob_assign only enables
globbing after the other expansions. The other expansions will still
produce a single word.
Zoltan
next prev parent reply other threads:[~1996-08-22 3:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <199608162344.QAA02058@envy.ugcs.caltech.edu>
1996-08-16 23:52 ` Zefram
1996-08-21 18:35 ` Zoltan Hidvegi [this message]
1996-08-21 21:52 ` Patches for New Features Greg J. Badros
1996-08-16 23:02 zsh3.0.0 bug: $=a split Huy Le
1996-08-16 23:34 ` Zefram
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=199608211835.UAA08558@bolyai.cs.elte.hu \
--to=hzoli@cs.elte.hu \
--cc=A.Main@dcs.warwick.ac.uk \
--cc=huyle@arachno.ugcs.caltech.edu \
--cc=zsh-workers@math.gatech.edu \
/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).