From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26520 invoked by alias); 2 Nov 2011 05:06:44 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16552 Received: (qmail 17759 invoked from network); 2 Nov 2011 05:06:41 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, HTML_MESSAGE,RCVD_IN_DNSWL_LOW,T_DKIM_INVALID autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.160.171 as permitted sender) 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= MIME-Version: 1.0 Sender: 4wayned@gmail.com In-Reply-To: <20111102033545.GI28043@solfire> References: <20111102033545.GI28043@solfire> Date: Tue, 1 Nov 2011 22:00:50 -0700 X-Google-Sender-Auth: -Wo12O0ja-rP25Q8dEYX-Oy6faE Message-ID: Subject: Re: Array as parameter From: Wayne Davison To: meino.cramer@gmx.de Cc: zsh-users@zsh.org Content-Type: multipart/alternative; boundary=000e0cd299861c09c804b0b95bb8 --000e0cd299861c09c804b0b95bb8 Content-Type: text/plain; charset=UTF-8 On Tue, Nov 1, 2011 at 8:35 PM, 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.. --000e0cd299861c09c804b0b95bb8--