zsh-users
 help / color / mirror / code / Atom feed
* revisiting passing arrays to functions
@ 2016-10-20 19:32 Filipe Silva
  2016-10-20 21:04 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Filipe Silva @ 2016-10-20 19:32 UTC (permalink / raw)
  To: zsh-users

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

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-20 22:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-20 19:32 revisiting passing arrays to functions Filipe Silva
2016-10-20 21:04 ` Bart Schaefer

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).