From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27036 invoked by alias); 25 Jul 2017 05:42: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: X-Seq: 41453 Received: (qmail 5502 invoked from network); 25 Jul 2017 05:42:48 -0000 X-Qmail-Scanner-Diagnostics: from aok120.rev.netart.pl by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(85.128.245.120):SA:0(0.0/5.0):. Processed in 2.829107 secs); 25 Jul 2017 05:42:48 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: psprint@zdharma.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at zdharma.org does not designate permitted sender hosts) X-Virus-Scanned: by amavisd-new using ClamAV (15) Date: Tue, 25 Jul 2017 07:42:39 +0200 From: Sebastian Gniazdowski To: Bart Schaefer , "=?utf-8?Q?zsh-workers=40zsh.org?=" Message-ID: In-Reply-To: References: Subject: Re: Can ZWC be optimized, for lesser depths of recursive exec* calls? X-Mailer: Airmail (442) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 25 lipca 2017 at 07:04:07, Bart Schaefer (schaefer=40brasslantern.com)= wrote: > On Mon, Jul 24, 2017 at 6:26 PM, Sebastian Gniazdowski > wrote: > > > > It's just that I suspect =22recurse and forget=22 tactics in exec.c. > =20 > I don't know what you mean by this. The example in comment in exec.c is: =C2=A0 =C2=A0 cat foo =7C while read a; do grep =24a bar; done Expected calls are: =C2=A0 =C2=A0 execlist->execpline->execcmd->execwhile->execlist->execplin= e This shows that grep is treated as a potential pipe. So what I mean is th= at the problem with pipes (the topic of the comment) is solved by having = enough general execpline(), and then just recursing, always, and expect a= positive outcome to be computed. Like the zlecore() example =E2=80=93 ma= in Zle works, so calling it again =22should not cause problems=22, to sim= ulate typical programmer thinking in such situation. So it's an opportuni= ty to not write new code, just reuse what's there already, tested and wor= king. -- =20 Sebastian Gniazdowski psprint /at/ zdharma.org