From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7003 invoked from network); 30 Sep 1999 17:00:21 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 30 Sep 1999 17:00:21 -0000 Received: (qmail 5180 invoked by alias); 30 Sep 1999 17:00:11 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8116 Received: (qmail 5153 invoked from network); 30 Sep 1999 17:00:09 -0000 From: "Bart Schaefer" Message-Id: <990930165807.ZM25240@candle.brasslantern.com> Date: Thu, 30 Sep 1999 16:58:07 +0000 In-Reply-To: <9909281304.AA18217@ibmth.df.unipi.it> Comments: In reply to Peter Stephenson "Re: assoc array assignment problem." (Sep 28, 3:04pm) References: <9909281304.AA18217@ibmth.df.unipi.it> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.auc.dk Subject: Re: assoc array assignment problem. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 28, 3:04pm, Peter Stephenson wrote: } Subject: Re: assoc array assignment problem. } } I discovered another problem. } } foo= } assoc[$foo]=rod } print ${(kv)assoc} } rod $foo bar The fact that you get a leading space there even when there are no quotes around the expansion should be telling us something. If the key were the empty string, print would drop it and you'd get "rod $foo bar" with no leading space. The key for the "rod" value in the $assoc hash table is "\233" (meta-escape). Now, the "\233" is coming from singsub(&s) where s = "$foo" at line 863 in getarg(). So perhaps the following will take care of it; I've tried a few tests and didn't find anything that it breaks, but maybe someone else will discover a reason this needs to be more complicated. Index: Src/params.c =================================================================== @@ -869,6 +869,7 @@ ht = newparamtable(17, v->pm->nam); v->pm->sets.hfn(v->pm, ht); } + untokenize(s); if (!(v->pm = (Param) ht->getnode(ht, s))) { HashTable tht = paramtab; paramtab = ht; -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com