zsh-users
 help / color / mirror / code / Atom feed
* local arrays
@ 1999-01-13 10:12 Phil Pennock
  1999-01-13 16:15 ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Phil Pennock @ 1999-01-13 10:12 UTC (permalink / raw)
  To: Zsh Users

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?

I can do
 local foo; set -A foo a b c
which does create a local array, but can't see a way to do this
manually.  And since there's no typeset for it ...

Thanks
-- 
--> 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?


^ permalink raw reply	[flat|nested] 6+ messages in thread
* Local arrays
@ 2013-02-06 15:41 Atte Peltomäki
  2013-02-06 16:01 ` Peter Stephenson
  0 siblings, 1 reply; 6+ messages in thread
From: Atte Peltomäki @ 2013-02-06 15:41 UTC (permalink / raw)
  To: zsh-users

Hi,

Can someone explain the following behaviour in declaring local arrays?

% F () { local -a foo=(one two three); echo $foo ; }
% F
F: unknown file attribute

% F () { local foo=(one two); echo $foo ; }
% F
F: missing end of string

% F () { local foo=(moi hei); echo $foo ; }
% F
F: number expected

% F () { local -a foo; foo=(one two three); echo $foo ; }
% F
one two three

% echo $ZSH_VERSION
4.3.17

-- 
Atte Peltomäki
     atte.peltomaki@iki.fi <> http://kameli.org
"Your effort to remain what you are is what limits you"


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-02-06 16:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-01-13 10:12 local arrays Phil Pennock
1999-01-13 16:15 ` Bart Schaefer
1999-01-13 16:58   ` Phil Pennock
1999-01-13 16:57     ` Peter Stephenson
2013-02-06 15:41 Local arrays Atte Peltomäki
2013-02-06 16:01 ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).