From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27042 invoked from network); 13 Jan 1999 17:00:08 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 13 Jan 1999 17:00:08 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id LAA08177; Wed, 13 Jan 1999 11:58:42 -0500 (EST) Resent-Date: Wed, 13 Jan 1999 11:58:38 -0500 (EST) Message-ID: <19990113165807.A10044@fysh.org> Date: Wed, 13 Jan 1999 16:58:07 +0000 From: Phil Pennock To: Zsh Users Subject: Re: local arrays Mail-Followup-To: Zsh Users References: <19990113101208.A6023@fysh.org> <990113081507.ZM17393@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.2 In-Reply-To: <990113081507.ZM17393@candle.brasslantern.com>; from "Bart Schaefer" on Wed 13 Jan 1999 (8:15 -0800) Organisation: Organisation? Here? No, over there ----> X-Disclaimer: Any views expressed in this message, where not explicitly attributed otherwise, are mine and mine alone. Such views do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. Resent-Message-ID: <"m7XKj2.0._-1.z2Dds"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/2017 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu 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?