From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 163947ed for ; Thu, 29 Aug 2019 02:49:23 +0000 (UTC) Received: (qmail 17959 invoked by alias); 29 Aug 2019 02:49:13 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24191 Received: (qmail 16559 invoked by uid 1010); 29 Aug 2019 02:49:12 -0000 X-Qmail-Scanner-Diagnostics: from mail-ua1-f45.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25552. spamassassin: 3.4.2. Clear:RC:0(209.85.222.45):SA:0(-2.0/5.0):. Processed in 2.241509 secs); 29 Aug 2019 02:49:12 -0000 X-Envelope-From: sgniazdowski@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.222.45 as permitted sender) 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=aFUnPe1oxgb1zB3O4u/obz5IF8SdrnRt2QQVjJyhu8Y=; b=tHFC7Tz9MuART6iw4lH0b5aEJGXCQC/rRYXL4jTVJkX+SVqCeAJejJmJRKFGcfVifr yOsJrDv8JQBGIPjd9sG4R/RxdewOMYWnXX9mK5CX/R8rSxeu+fTVs8VdRFo97w/szvmP nEZ1o7OMU6twcAPzQpaeC0WAlQm/2eocQ6b3yf01Y++fWRBSH7ntxJXXzGydxm25WSHb 0X3VDbDyrz23RTKbtS5XCIskyHDLZsFNfJwjeK5dw88vgi42l5NnKVuDlTrO0gkNulz4 U5OujHIQ/KNjnuQBhxxjiyCAtp3ELwswYjM5fyNQub3ib1FYCosKYBUHVz/IPKQFOZvh qRIQ== X-Gm-Message-State: APjAAAW6WCqXFX8MPaKJwDKjfmwx9wBKX/6yvLdTLd58pu87Y998RzR1 xlyk79EA4edhVEhR9PbyDu7VSNAvgOuFQFl+PoW5co3n X-Google-Smtp-Source: APXvYqztoGfRI4p6bGqSUXGhLvdxyDisz6OUDWEy+uOSysA9aG1N0YOlvYLzeS8sfzwoESEwZfEFAxNHz+UAvPAq1KU= X-Received: by 2002:ab0:72da:: with SMTP id g26mr3534178uap.136.1567046916474; Wed, 28 Aug 2019 19:48:36 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Sebastian Gniazdowski Date: Thu, 29 Aug 2019 04:47:50 +0200 Message-ID: Subject: Re: A way to apply function to each element of an array To: Zsh Users Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 29 Aug 2019 at 02:49, Sebastian Gniazdowski wrote: > ... > assigns to REPLY, assuming that func can take some arguments (i.e. the > $MATCH in the use case): This is not needed =E2=80=93 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 =E2=80=93 just a doshfunc(() followed by getstrvalue("REPLY"). If there are any pitfalls in it then let me know it. --=20 Sebastian Gniazdowski News: https://twitter.com/ZdharmaI IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin Blog: http://zdharma.org