3 ms·
Just to clarify: err = catch-all(expr) If your language does not provide a similar tool, you can't just use a function because "expr" is evaluated before
by junke 10y ago
Just to clarify:
err = catch-all(expr)
If your language does not provide a similar tool, you can't just use a function because "expr" is evaluated before the function is called. I had Lisp macros in mind when writing this. A poor man's approach that is still generic is to wrap the expression in a closure:
err = catch-all(() -> expr)
Not too cumbersome, but YMMV.