Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Array as parameter



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