Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: 3.1.5 - sample associative array implementation
- X-seq: zsh-workers 4638
- From: Timothy Writer <Tim.Writer@xxxxxxxxxx>
- To: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: PATCH: 3.1.5 - sample associative array implementation
- Date: 15 Nov 1998 03:42:58 -0500
- Cc: zsh-workers@xxxxxxxxxxxxxxx
- In-reply-to: "Bart Schaefer"'s message of "Fri, 13 Nov 1998 22:41:37 -0800"
- References: <9811111358.AA51361@xxxxxxxxxxxxxxxxx> <vb1znanvcm.fsf@xxxxxxxxxxxxxxx> <m3iugmj8y8.fsf@xxxxxxxxxxxxxxxxx> <981111125236.ZM3587@xxxxxxxxxxxxxxxxxxxxxxx> <m3d86t7235.fsf@xxxxxxxxxxxxxxxxx> <981112012358.ZM9722@xxxxxxxxxxxxxxxxxxxxxxx> <m367ck7907.fsf@xxxxxxxxxxxxxxxxx> <981112173201.ZM13829@xxxxxxxxxxxxxxxxxxxxxxx> <m3zp9v597a.fsf@xxxxxxxxxxxxxxxxx> <981113224137.ZM20181@xxxxxxxxxxxxxxxxxxxxxxx>
"Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx> 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@xxxxxxxxxx
FTL Solutions Inc.
Toronto, Ontario, CANADA
Messages sorted by:
Reverse Date,
Date,
Thread,
Author