zsh-users
 help / color / mirror / code / Atom feed
From: Wayne Davison <wayned@users.sourceforge.net>
To: meino.cramer@gmx.de
Cc: zsh-users@zsh.org
Subject: Re: Array as parameter
Date: Tue, 1 Nov 2011 22:00:50 -0700	[thread overview]
Message-ID: <CAHSx_SsGPHWkGfspXKo39oZ6G3Rd+H-8_2PAuixHmW94d4VCEg@mail.gmail.com> (raw)
In-Reply-To: <20111102033545.GI28043@solfire>

[-- Attachment #1: Type: text/plain, Size: 519 bytes --]

On Tue, Nov 1, 2011 at 8:35 PM, <meino.cramer@gmx.de> 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..

      reply	other threads:[~2011-11-02  5:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-02  3:35 meino.cramer
2011-11-02  5:00 ` Wayne Davison [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHSx_SsGPHWkGfspXKo39oZ6G3Rd+H-8_2PAuixHmW94d4VCEg@mail.gmail.com \
    --to=wayned@users.sourceforge.net \
    --cc=meino.cramer@gmx.de \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).