bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: feature request: new builtin `defer`, scope delayed eval


From: Oğuz
Subject: Re: feature request: new builtin `defer`, scope delayed eval
Date: Sat, 8 Oct 2022 13:00:32 +0300

8 Ekim 2022 Cumartesi tarihinde Cynthia Coan <cynthia@coan.dev> yazdı:
>
> [...] I think
> use cases outside of cleanup are relatively sparse, [...]


There. There already are several ways to do cleanup on exit/return using
existing features, why add one more?


> [...] With your syntax you still have to be aware of what's
> in that trap [...]
>

Not really. If, for some reason, I didn't know what's in that trap and were
super paranoiac about it, I could do

    oldaction=$(trap -P EXIT)
    trap 'eval "$oldaction"; bar' EXIT

I've never been in such a situation though.

Don't get me wrong, I just like it when new features align with the old
ones and work together nicely.


-- 
Oğuz


reply via email to

[Prev in Thread] Current Thread [Next in Thread]