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

Re: local arrays



Typing away merrily, Bart Schaefer produced the immortal words:
> On Jan 13, 10:12am, Phil Pennock wrote:
> } Is there a way in zsh-3.0.5 (or zsh-3.1.x) to use one command to declare
> } a variable to be both local and an array?
> 
> No, there isn't.  This is even documented, poorly (a bit better in pws-4,
> because it was part of my rewrite of the `typeset' documentation).
> 
> Why do you need to do this?  The variable will assume array-ness upon the
> first array assignment to it.

Cleanliness.  Obviousness of purpose.

The scripts I write are liable to be modified by others.  So the purpose
of stuff should be clear.  Nice clean explicit statements of what a
variable is help.  So integers get declared as such, etc.  And if that
adds type-checking, all the better.

I just prefer zsh to perl ...
-- 
--> Phil Pennock ; GAT d- s+:+ a23 C++(++++) UL++++/I+++/S+++/H+ P++@ L+++
E-@ W(+) N>++ o !K w--- O>+ M V !PS PE Y+ PGP+ t-- 5++ X+ R !tv b++>+++ DI+ D+
G+ e+ h* r y?



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