Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Fix ERR_EXIT behavior in function calls and "always" statements
- X-seq: zsh-workers 51021
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Philippe Altherr <philippe.altherr@xxxxxxxxx>
- Cc: Lawrence Velázquez <larryv@xxxxxxx>, zsh-workers@xxxxxxx
- Subject: Re: [PATCH] Fix ERR_EXIT behavior in function calls and "always" statements
- Date: Mon, 21 Nov 2022 20:51:25 -0800
- Archived-at: <https://zsh.org/workers/51021>
- In-reply-to: <CAGdYchvM8uwvQ9B-S4n_-oMQkNqgZZrqG9jwYCV7Nz+5Lo6Q=w@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAGdYchvfLWmxrCZ3-8ThXdyeuMAUWbV=SqFrXCjSJ8AnWpek9A@mail.gmail.com> <CAGdYchufLwUgpKVU6b5eOiF15p0njFr59H1q9XizypwNjzqKzw@mail.gmail.com> <CAH+w=7ZLr8R_pQfpcAdHiNyYH0K_A8ha815nz1zPBakYmCJ6Dg@mail.gmail.com> <230a78bb-fa97-4f3a-94a2-86982316274b@app.fastmail.com> <CAGdYchvM8uwvQ9B-S4n_-oMQkNqgZZrqG9jwYCV7Nz+5Lo6Q=w@mail.gmail.com>
On Mon, Nov 21, 2022 at 6:52 PM Philippe Altherr
<philippe.altherr@xxxxxxxxx> wrote:
>
For anyone arriving in the middle of the conversation or viewing this
in the archives --
Please note that I wrote this:
>> Each time though, you've removed the NEWS item. Although we've
>> established that the behavior it describes was not actually
>> appropriate, there still has been a change in ERR_EXIT behavior that
>> probably warrants a mention. What's the best description of that?
Whereas Lawrence wrote this:
>> This suggests that anonymous
>> functions should *not* behave like normal function calls here.
> That's debatable. If, like me, you see anonymous functions as some kind of syntactic sugar, then it makes sense that they behave like function calls and exit. However, I can also understand that others rather see them as another type of compound command. In that case, they should not exit.
I think it's probably more appropriate to view a function, even an
anonymous one, like a subshell rather than like either a simple or a
complex command. Subshells also "pop the bubble" to use Lawrence's
analogy, so it's probably fine for anonymous functions to do so.
> FYI: Here are my next steps
> - Write NEWS for my 3 fixes.
> - Better document the role and usage of noerrexit and this_noerrexit.
> - Try to fix "eval", "source", and possibly a bunch of other related cases.
>
> Unless anyone sees a reason not to, it would be nice to submit my first pacth, which reverts Bart's changes. For the other patches, I have at the very least to first add a NEWS item.
I don't think there's any requirement that the NEWS item arrive at the
same time as the other three patches. We sometimes don't add NEWS
until the time of a release, months (years) after a patch was pushed
to sourceforge git.
I'd also prefer to post all your patches at once because you attached
them all to the same zsh-workers article. Convention has been that a
series of patches should be sent as a series of articles.
I think I will go ahead and remove (most of) the ChangeLog references
to my patches, unless anyone feels they're important for context (the
git log of course remains).
Messages sorted by:
Reverse Date,
Date,
Thread,
Author