Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Can ZWC be optimized, for lesser depths of recursive exec* calls?
- X-seq: zsh-workers 41453
- From: Sebastian Gniazdowski <psprint@xxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Subject: Re: Can ZWC be optimized, for lesser depths of recursive exec* calls?
- Date: Tue, 25 Jul 2017 07:42:39 +0200
- In-reply-to: <CAH+w=7bsXtfucwrjOga8VNWU5hHwtu7eaLRuYiw3wZE+NLDnxw@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <etPan.5970cf0e.4c5f2547.6b4@zdharma.org> <etPan.5970eb83.495b9d04.6b4@AirmailxGenerated.am> <etPan.59769e28.2447d90.188@zdharma.org> <CAH+w=7bsXtfucwrjOga8VNWU5hHwtu7eaLRuYiw3wZE+NLDnxw@mail.gmail.com>
On 25 lipca 2017 at 07:04:07, Bart Schaefer (schaefer@xxxxxxxxxxxxxxxx) wrote:
> On Mon, Jul 24, 2017 at 6:26 PM, Sebastian Gniazdowski
> wrote:
> >
> > It's just that I suspect "recurse and forget" tactics in exec.c.
>
> I don't know what you mean by this.
The example in comment in exec.c is:
cat foo | while read a; do grep $a bar; done
Expected calls are:
execlist->execpline->execcmd->execwhile->execlist->execpline
This shows that grep is treated as a potential pipe. So what I mean is that 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 – main Zle works, so calling it again "should not cause problems", to simulate typical programmer thinking in such situation. So it's an opportunity to not write new code, just reuse what's there already, tested and working.
--
Sebastian Gniazdowski
psprint /at/ zdharma.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author