From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3560 invoked from network); 14 Nov 1998 02:10:37 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 14 Nov 1998 02:10:37 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id VAA01992; Fri, 13 Nov 1998 21:08:17 -0500 (EST) Resent-Date: Fri, 13 Nov 1998 21:08:17 -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> Mime-Version: 1.0 (generated by tm-edit 7.108) Content-Type: text/plain; charset=US-ASCII From: Timothy Writer Date: 13 Nov 1998 20:55:53 -0500 In-Reply-To: "Bart Schaefer"'s message of "Thu, 12 Nov 1998 17:32:01 -0800" Message-ID: X-Mailer: Gnus v5.5/XEmacs 20.4 - "Emerald" Resent-Message-ID: <"JO7bB.0.0V.HOEJs"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4628 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu "Bart Schaefer" writes: > On Nov 12, 7:04pm, Timothy Writer wrote: > > Subject: Re: PATCH: 3.1.5 - sample associative array implementation > [Referring to ksh93] > > > > typeset -A foo > > foo[bar]=baz > > echo ${!foo} > > > > just prints "foo". Makes sense because foo is not a nameref. > > That's not what I would have expected; I would have expected it to either > (a) behave the same as ${foo} [which means what, when foo is an associative > array?] or (b) print nothing, because there's no variable to which the value > of foo can possibly refer. Printing its own *name* like that isn't sensible > to me. In ksh93, $arrayname is a synonym for ${arrayname[0]}. This appears to be true for indexed arrays _and_ associative arrays. If you think of nameref as being like a symbolic link and ${!foo} as being like lstat(), it makes perfect sense (at least to my twisted mind) that ${!foo} is just "foo" for ordinary (non nameref) variables. -- Tim Writer Tim.Writer@ftlsol.com FTL Solutions Inc. Toronto, Ontario, CANADA