From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14326 invoked from network); 15 Nov 1998 08:44:02 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 15 Nov 1998 08:44:02 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id DAA25278; Sun, 15 Nov 1998 03:42:54 -0500 (EST) Resent-Date: Sun, 15 Nov 1998 03:42:54 -0500 (EST) To: "Bart Schaefer" Cc: zsh-workers@math.gatech.edu Subject: Re: PATCH: 3.1.5 - sample associative array implementation References: <9811111358.AA51361@ibmth.df.unipi.it> <981111125236.ZM3587@candle.brasslantern.com> <981112012358.ZM9722@candle.brasslantern.com> <981112173201.ZM13829@candle.brasslantern.com> <981113224137.ZM20181@candle.brasslantern.com> Mime-Version: 1.0 (generated by tm-edit 7.108) Content-Type: text/plain; charset=US-ASCII From: Timothy Writer Date: 15 Nov 1998 03:42:58 -0500 In-Reply-To: "Bart Schaefer"'s message of "Fri, 13 Nov 1998 22:41:37 -0800" Message-ID: X-Mailer: Gnus v5.5/XEmacs 20.4 - "Emerald" Resent-Message-ID: <"t8FGJ.0.sA6.EGfJs"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4638 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu "Bart Schaefer" writes: > On Nov 13, 8:55pm, Timothy Writer wrote: > } Subject: Re: PATCH: 3.1.5 - sample associative array implementation > } > } In ksh93, $arrayname is a synonym for ${arrayname[0]}. This appears to be > } true for indexed arrays _and_ associative arrays. > > So it actually dereferences a slot with key "0" and substitutes the value > that is there? And substitutes nothing if there is no key "0"? Or ...? It appears to. > (In the zsh implementation from my + PWS's patches, with `emulate ksh' in > effect, $arrayname prints the first hash table element in whatever order > the hash happens to get traversed, which may change as elements are added. Perhaps that's why they go to the trouble of dereferencing a slot with key "0", so its predictable. > That leads to the question, how do you remove a particular key/value pair > from a ksh93 associative array?) "unset foo[bar]" seems to work. -- Tim Writer Tim.Writer@ftlsol.com FTL Solutions Inc. Toronto, Ontario, CANADA