zsh-workers
 help / color / mirror / code / Atom feed
* clone an associative array?
@ 2005-08-19 14:13 Marc Chantreux
  2005-08-19 14:24 ` Peter Stephenson
  2005-08-19 14:25 ` Stephane Chazelas
  0 siblings, 2 replies; 5+ messages in thread
From: Marc Chantreux @ 2005-08-19 14:13 UTC (permalink / raw)
  To: zsh-workers

hello all,

i don't know what i missed in 'parameters expansions' manual but i'm
unable to clone an associative array :

% typeset -A homemade
% homemade=( tm myself c 2005 )
% echo $homemade[tm]
myself

% typeset -A counterfeit
% counterfeit=${homemade}

% echo $counterfeit[c]
m

% counterfeit="${homemade}"
% echo $counterfeit[c]
m

% counterfeit="${(AA)homemade}"
% echo $counterfeit[c]
m

% counterfeit="${(A)homemade}"
% echo $counterfeit[c]
m

# other tries failed too ...

in a future time, i would like to write something as :

func () {
    local who=$1
    shift
    local -A config
    config=$@

    # implementation here ....

}

i'm sure that it is possible, i just want to know how.

regards
mc


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

end of thread, other threads:[~2005-08-19 14:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-19 14:13 clone an associative array? Marc Chantreux
2005-08-19 14:24 ` Peter Stephenson
2005-08-19 14:30   ` Peter Stephenson
2005-08-19 14:30   ` Stephane Chazelas
2005-08-19 14:25 ` Stephane Chazelas

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).