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=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,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 bd7fbcbf for ; Sat, 7 Sep 2019 00:31:04 +0000 (UTC) Received: (qmail 7797 invoked by alias); 6 Sep 2019 23:16:48 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 44735 Received: (qmail 15838 invoked by uid 1010); 6 Sep 2019 23:16:48 -0000 X-Qmail-Scanner-Diagnostics: from mail-vs1-f65.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25559. spamassassin: 3.4.2. Clear:RC:0(209.85.217.65):SA:0(-2.0/5.0):. Processed in 1.770649 secs); 06 Sep 2019 23:16:48 -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.217.65 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; bh=ZXd0+BIGWjXGhnlaINK7btfZ0hyAqzF0PphyaG2J76E=; b=AzDB84rR3LRuCsJmfaBdMm798xtjqWYBkvNKAYsjELOsY0K3yuUIZhRuDLo/wtGwMh hpy/kvELwQfQK+KSggFElxI5C3mCwIqIGqCL2x4Ehw1a3un3X1ZQyHjQMfaGT4LulbBs YBxCYJmgL+TB4vWCNMoHwV4HzZHdhD4OGhHIfEz4KGXTAMehRxdUS18rpZRnGWhb4Q2Q d1W6HYr7suJxh5NK0WUUg4MZSjo0/lGgysWY36cxuFdt5IJiEGPkQ5xyObN0NVxlbKai gDT3v//MqRQ2m1oOyr5wipjOpvwXgS/I+DRw7/z4HmN2HgLNq/Nux2YGH2Pt/yZqGNA6 OJkA== 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; bh=ZXd0+BIGWjXGhnlaINK7btfZ0hyAqzF0PphyaG2J76E=; b=M/KKL1iMzPI3btD4dgrfONS92qXF0qtVwuc/G9AdxC7RaaakWCt9X5RAhHJ/ztjLgm 0hHzOJLVpVO8wmYAVZMgZvFy+RNMqYr9xMsOrSqae9SLM9AXGq/4Ly5+BSoZfkHPT6gv YNOpTyOINgVXlwm31zoNIileImJjVJRTBm5FOTccZBD7Wa/IARszpb9dE8N3qJiKQ84e eMkj3PTd1BiaBdDjXLn/SREAudYRucflFSfwLlvt4VxxJSc/SwxqW9JiaMsGKp6BJe8s aEFI9Hz1ofTLHdGtjDp6Qdxjkkmm1sI7FlyuWu5IoWjReYl4vzDQ/0tIOUk5jdw5ON0e 9uIQ== X-Gm-Message-State: APjAAAWSswhgjKuujUurzOF7VRU89KEXxNulPsPV31nnRnw3ZLSgPqkP NzofHjLmpyf37ykSEKMJh5dIfw0rRw6rxuQLEPIA7IUT X-Google-Smtp-Source: APXvYqyaqrWDKBUKcWzoX3L/SInLSkPvZmoinRt4EZuQRpZEu5jA4jnbBT1A5yXgVqHNHNEVgNoKMnmF623L+TrOON8= X-Received: by 2002:a67:e3c2:: with SMTP id k2mr5607070vsm.77.1567811773038; Fri, 06 Sep 2019 16:16:13 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Sebastian Gniazdowski Date: Sat, 7 Sep 2019 01:16:00 +0200 Message-ID: Subject: Re: [PATCH] Support the mksh's ${|func;} substitution To: Zsh hackers list Content-Type: multipart/alternative; boundary="000000000000ce8dbf0591ea9f74" --000000000000ce8dbf0591ea9f74 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I see no response. Is it because the substitution isn't zsh-like, ie. flag based? I can prepare such patch, ie. assign a flag and integrate it nicely into the zsh substitution stack. pt., 6 wrz 2019, 02:52 u=C5=BCytkownik Sebastian Gniazdowski < sgniazdowski@gmail.com> napisa=C5=82: > Hello > Some notes on the patch: > - the subst is being handled at top of paramsubst, because it's made > uncompatible with (...)-flags (${|(U)funct;} looks awful, more on this > in the patch), > - then the `s' variable is advanced past the semicolon, so that the > rest of the function can safely progress doing (almost) nothing > - one thing that the function still does is a fetchvalue, which I > prevent from setting vunset to 1 in case of ${|func;} > > If commited, the substitution will be super useful in // substitution. > E.g.: > > arr=3D( val1 val2 abc1 abc3 ) > func() { REPLY=3D"${(C)match[1]}"; } > print -rl ${arr[@]//(#b)(*)/${|func;}} > > Output: > Val1 > Val2 > Abc1 > Abc3 > > PS. I did install mksh and test the substitution, it works the same. > -- > Sebastian Gniazdowski > News: https://twitter.com/ZdharmaI > IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin > Blog: http://zdharma.org > --000000000000ce8dbf0591ea9f74--