Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: A way to apply function to each element of an array
- X-seq: zsh-users 24191
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: A way to apply function to each element of an array
- Date: Thu, 29 Aug 2019 04:47:50 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=aFUnPe1oxgb1zB3O4u/obz5IF8SdrnRt2QQVjJyhu8Y=; b=JNiUTbvxn0oYApPQfIFsxYJZmX0RzaRU1GZ6GMGD77xoUigQAEuPmE5JYI7oyaVlKy vsj81Netdm15MlxDnShVxZ3SggN/jd8ixsVNSS6XAnLa35egQVMCKhatM3gzLrIQwyxB bZ52mUpl+3t23Wfp+a0Knb4h2Qea0Ewg80UAJrbO1qx+o9mujFFLYNtCfFCLLxN28UJn l2SqBYZTj/dtzOPEfMF3JcPU+toVm8E9YG1b5/9Cqsw6Q6yXvS8n2qdtWqusgjJk6iwF G5ShMQStWX6YHz6/zi60Qavo9SYmeOK0MBCp0ZOQb3v46ufc9VCo0AlQpIZpLOlYmvI8 CZKw==
- In-reply-to: <CAKc7PVD1Lr-Z1LasY7=kyP5-a7NMZDrWxwJjCgPyX0Axu3UbOw@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVD1Lr-Z1LasY7=kyP5-a7NMZDrWxwJjCgPyX0Axu3UbOw@mail.gmail.com>
On Thu, 29 Aug 2019 at 02:49, Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> wrote:
> ...
> assigns to REPLY, assuming that func can take some arguments (i.e. the
> $MATCH in the use case):
This is not needed – the function could use $MATCH directly.
I was assuming that adding such substitution would require parser
alteration, however it doesn't seem to:
% echo ${|foo;}
zsh: bad substitution
So the syntax correctly passes the parser and meets paramsubst() or
stringsubst(). So adding such substitution should be easy – just a
doshfunc(() followed by getstrvalue("REPLY"). If there are any
pitfalls in it then let me know it.
--
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author