Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Fix ERR_EXIT behavior in function calls and "always" statements



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