Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: 3.1.5 - sample associative array implementation



On Nov 11,  3:00pm, Timothy Writer wrote:
} Subject: Re: PATCH: 3.1.5 - sample associative array implementation
}
} In ksh93 associative arrays are declared using "typeset -A".

This could easily be mimicked.

} They use the
} same syntax as indexed arrays, e.g. "foo[bar]=baz"; the text within [] is
} subject to variable expansion and whitespace counts.

Hrm.  Zsh currently can't handle whitespace inside the [ ]; and I'm not
sure the paramtab implementation I did will work with keys that aren't
parsable as "identifier".

Otherwise this is good.

How can you (or can you not) assign to multiple elements simultaneously?

} The following special notation is used to get all keys:
} 
}     "${!arrayname[@]}"

Exactly what about that is the special notation?  The `!'?  Does ksh93
recognize other special characters in that position?  Is there any way
to get both the keys and the values in a single expansion?

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author