From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: A way to apply function to each element of an array
Date: Thu, 29 Aug 2019 04:47:50 +0200 [thread overview]
Message-ID: <CAKc7PVCr49fpDDZQQjQUkHfQZ-G0902VqwK=RRJpjJkBmGzw9A@mail.gmail.com> (raw)
In-Reply-To: <CAKc7PVD1Lr-Z1LasY7=kyP5-a7NMZDrWxwJjCgPyX0Axu3UbOw@mail.gmail.com>
On Thu, 29 Aug 2019 at 02:49, Sebastian Gniazdowski
<sgniazdowski@gmail.com> 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
next prev parent reply other threads:[~2019-08-29 2:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-29 0:49 Sebastian Gniazdowski
2019-08-29 2:47 ` Sebastian Gniazdowski [this message]
2019-08-29 10:46 ` Roman Perepelitsa
2019-08-29 11:13 ` Sebastian Gniazdowski
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='CAKc7PVCr49fpDDZQQjQUkHfQZ-G0902VqwK=RRJpjJkBmGzw9A@mail.gmail.com' \
--to=sgniazdowski@gmail.com \
--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).