3 ms·
Interesting idea. I have thought about doing the trap cleanup but found it cumbersome to reason about when there are many functions so this is helpful. I would
by memco 5y ago
Interesting idea. I have thought about doing the trap cleanup but found it cumbersome to reason about when there are many functions so this is helpful. I would like to have seen a complete example at the end rather than just explaining why it's cool and then leaving it to the reader to imagine what it looks like.
Besides cleanup, one thing I think I would love to see is a good mechanism for logging. I have started to build a file for functions and then other files, which source that as a library and calls the functions as needed. I would love to be able to tell the library functions to log something if the parent file wants it, print to stderr or stdout by default or be silent if the caller wants that instead.