Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: value of a key pointed by (P) ?
- X-seq: zsh-users 10724
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: value of a key pointed by (P) ?
- Date: Fri, 15 Sep 2006 22:57:01 -0700
- In-reply-to: <20060915201704.GA14417@xxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20060915174734.GA14349@xxxxxxxxxxxxxxxxxx> <20060915185628.4641deb7.pws@xxxxxxx> <20060915201704.GA14417@xxxxxxxxxxxxxxxxxx>
On Sep 15, 10:17pm, Marc Chantreux wrote:
} Subject: Re: value of a key pointed by (P) ?
}
} le 15/09/2006,
} Peter Stephenson nous écrivait :
} > The expression generated by ${(P)b} is passed back as an ordinary array,
}
} isn't it a bug?
No, it's not. ${(P)b} is "the value of the thing named by the value of
b" and the value of the parameter a is an ordinary array consisting of
all the values of the associative array.
What you want are name references, that is, "the thing named by the
value of b" (note the difference -- missing one "value of"). Zsh
doesn't have those yet, and when it does they probably won't be
implemented via parameter expansion flags.
Also consider:
b="a[$k]"
print ${(P)b}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author