From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16462 invoked from network); 7 Jul 1999 17:22:40 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 7 Jul 1999 17:22:40 -0000 Received: (qmail 6855 invoked by alias); 7 Jul 1999 17:22:11 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7022 Received: (qmail 6846 invoked from network); 7 Jul 1999 17:22:09 -0000 From: "Bart Schaefer" Message-Id: <990707171540.ZM2453@candle.brasslantern.com> Date: Wed, 7 Jul 1999 17:15:40 +0000 In-Reply-To: <002501bec88d$f467f470$21c9ca95@mow.siemens.ru> Comments: In reply to "Andrej Borsenkow" "${(A)=xxx} - second go - now real bug." (Jul 7, 7:32pm) References: <002501bec88d$f467f470$21c9ca95@mow.siemens.ru> X-Mailer: Z-Mail (5.0.0 30July97) To: "Andrej Borsenkow" , "ZSH workers mailing list" Subject: Re: ${(A)=xxx} - second go - now real bug. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jul 7, 7:32pm, Andrej Borsenkow wrote: } Subject: ${(A)=xxx} - second go - now real bug. } } [...] the WORD part *must* be converted to an array, for example } by using ${(AA)=...} to activate word splitting, when creating an } associative array. } } Please, note the last sentence. It implies, that in case of array/hash } assignment the word is treated as in array assignment - that is, } ${(A)foo=bar baz} is basically the same as foo=(bar baz). At least, I } find this natural and useful. And I have a feeling, that it was once } so. Read that sentence again, and note the word "converted." It has *never* been the case that ${(A)foo=bar baz} is the same as foo=(bar baz). } I suggest changing it to the described. That is, } } ${foo=bar} - the same as foo=bar (with blanks quoted, 'course) } ${(A)foo=bar}, ${(AA)foo=bar} - } the same as foo=(bar) I looked at this a bit when we had the last go-round about ${(A)foo=}. The problem is that foo=(bar baz) can be determined at lex time to be an array assignment by recognizing the parens, whereas ${(A)foo=bar baz} lexes as a parameter expansion. The lexer doesn't know that (A) is there, and therefore can't break "bar baz" into words; it reads the entire ${...} as a single string, which it is then up to the parameter expansion code to interpret. It has always been like this. } A good question is, if we should do globbing in above cases. I dare to say, } that it may be useful ... Yes, it would, and that is in fact the reason that I looked into the issue before. It doesn't work for the same reason; the entire ${...} has already been tokenized by the time it gets to the parameter code. It *might* be possible to undo the tokenization and re-parse the string, but that would involve invoking the lexer from the parameter code, which I was not prepared to undertake. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com