Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Array as parameter
- X-seq: zsh-users 16552
- From: Wayne Davison <wayned@xxxxxxxxxxxxxxxxxxxxx>
- To: meino.cramer@xxxxxx
- Subject: Re: Array as parameter
- Date: Tue, 1 Nov 2011 22:00:50 -0700
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=hIKkQs938uaG0I6m+DViHhApBttyTCBGZ5yraEDK+Nw=; b=p9FSpN2zRnCvHjBKkAF3INc6NuUdlFRKBkOkLeGUdb0TRgb/cdc2lKSgO+bGxv+q+x 5J912RHMqy/BVMHuhOKKh+5jKAtzg0x1/HRtMHmOoPQbdzUANmVms8l9YIyOUbP6NFvc +KWvEX1tY6FZS515gZX5rtT12HIOYw6VHLCp4=
- In-reply-to: <20111102033545.GI28043@solfire>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20111102033545.GI28043@solfire>
- Sender: 4wayned@xxxxxxxxx
On Tue, Nov 1, 2011 at 8:35 PM, <meino.cramer@xxxxxx> wrote:
> arrprint a
>
That passes the string "a" to the function. One thing you can do is to
pass the array as separate parameters (arrprint $a) and then use "for i in
$*" in your function. 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. With that one change, your function would work.
..wayne..
Messages sorted by:
Reverse Date,
Date,
Thread,
Author