Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Array as parameter
- X-seq: zsh-workers 29886
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Array as parameter
- Date: Wed, 2 Nov 2011 11:14:38 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=fR9ZLFfA5xj8/fHNJRVySy/WLqseLvG6ldpzF+YmuEE=; b=BL7vwUKvP/M4tWa3oSA8q94qQt3ZKItneo3a73QVRek7EQxf3zbnDTr7rb+9T78qkx pAfBovAoL/DrLDCRzC2j8Le6qrRtY47SpJr0QDWQXLoyq46OWMJgMJEMDcig7EZFHoqm 9zfX80deDy/HqCF4HYpdKfozZrsHZ/iXxo7Rw=
- In-reply-to: <slrnjb228m.67l.stephane.chazelas@spam.is.invalid>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20111102033545.GI28043@solfire> <CAHSx_SsGPHWkGfspXKo39oZ6G3Rd+H-8_2PAuixHmW94d4VCEg__34702.1825182766$1320210589$gmane$org@mail.gmail.com> <slrnjb228m.67l.stephane.chazelas@spam.is.invalid>
On 2 November 2011 10:10, Stephane CHAZELAS <stephane_chazelas@xxxxxxxx> wrote:
> 2011-11-1, 22:00(-07), Wayne Davison:
>> However, if you need to be able to keep the array
>> parameter separate from other parameters, you could instead refer to the
>> variable whose name you passed in using ${(P)1} in your function in place
>> of the $1.
>
> Except that it doesn't work for arrays. You'd need to use eval
> here.
(P) works perfectly fine with arrays.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author