From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dns.primenet.com.au (dns.primenet.com.au [203.24.36.40]) by coral.primenet.com.au (8.7.5/8.7.3) with ESMTP id NAA00348 for ; Thu, 22 Aug 1996 13:42:33 +1000 (EST) Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by dns.primenet.com.au (8.7.5/8.7.3) with ESMTP id EAA00786 for ; Thu, 22 Aug 1996 04:41:05 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id OAA05767; Wed, 21 Aug 1996 14:36:33 -0400 (EDT) Resent-Date: Wed, 21 Aug 1996 14:36:33 -0400 (EDT) From: Zoltan Hidvegi Message-Id: <199608211835.UAA08558@bolyai.cs.elte.hu> Subject: Re: zsh3.0.0 bug: $=a split To: A.Main@dcs.warwick.ac.uk (Zefram) Date: Wed, 21 Aug 1996 20:35:15 +0200 (MET DST) Cc: huyle@arachno.ugcs.caltech.edu, zsh-workers@math.gatech.edu In-Reply-To: <19648.199608162352@stone.dcs.warwick.ac.uk> from Zefram at "Aug 17, 96 00:52:23 am" Organization: Dept. of Comp. Sci., Eotvos University, Budapest, Hungary Phone: (36 1)2669833 ext: 2667, home phone: (36 1) 2752368 X-Mailer: ELM [version 2.4ME+ PL16 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"im5IQ2.0.-P1.mSr6o"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2042 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu [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