Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
revisiting passing arrays to functions
- X-seq: zsh-users 22013
- From: Filipe Silva <filipe.silva@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: revisiting passing arrays to functions
- Date: Thu, 20 Oct 2016 17:32:43 -0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=jaV238G5Fz2f92SPmbjkatkovc9T+xB/W4AdMGyY/MI=; b=VshIhpzsbd5jZLZXILY0n4w4+o5IpRwaP3mCikcf2cJHudvd+kMdVvY0RtcIuGnhCB UXcehu38yGqqPdEBqHxGCutfiKXy406T7QleRewpt5ULd8k1NZtB8Q78hXHNFJZKE3kE u5KfHEJFdGP07HJR7uQZtDOAGvcQ/EFHw5ik5bB17GqIyrOQVdb3/hYP+o1sidQ0GFXn Nytf+QKHIjB65ulZqWZ+G5RRGOEgXawtHI0m4IofFk3Oiw8Jbom/V1Q1jqsLo1gG60lJ O2l0UU4GdXrMeiFcOXb9b9F9U0je3s//spKEQtPJ8w1IBa/8zblXCU2v6io/awzUpPLq ZJPg==
- 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
I searched through the archives and found this message about passing arrays
to functions: http://www.zsh.org/mla/users/2011/msg00967.html
Basically it says that it is not very comfortable:
% deref() { print ${(P)1}; print ${(P)1[-1]}; }
% array=(there once was a hacker named dave)
% deref array
there once was a hacker named dave
dave
You have to dereference the array first.
But that was in 2011. Is that changed? Do we have a way to pass zsh
arrays to a zsh function in a comfortable way?
thanks in advance.
Filipe
Messages sorted by:
Reverse Date,
Date,
Thread,
Author