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

Re: two mysteries

On 11/07/2015 09:19 AM, Bart Schaefer wrote:
On Nov 7,  7:19am, Ray Andrews wrote:
} I think where I went off the rails is that this was part of  my trying
} to pass arrays (as we discussed) rather than flocks of independent
} values [...]
} ... and (so far) I don't know how to typeset an element of an array so

You can't typeset an element of an array.  Array elements (including
associative array elements) are presently always scalar.

That's my understanding.
   There is
some room in the implementation for associative array elements to be
differently-typed, but arrays are stored internally as literal (char**).

Incidentally "typeset -i -A foo" is not rejected as an error, but the -i
flag always wins and you get an integer rather than an array.

Yeah, I tried that and got a rude surprise. Shouldn't it be an error? So it boils down to using $(( )) to make sure things are correct. There were bound to be pitfalls trying to convert the whole data show to arrays, but it was educational and I think probably the right thing for organizational reasons. It didn't hurt speed. zsh with Cish data handling would be an awesome thing.

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