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

revisiting passing arrays to functions



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