4 ms·
This looks nice. I'm slightly surprised by the error handling though: if std.type() == "error" then It seems (a) a bit verbose and (b) a bit hacky to compar
by da39a3ee 4y ago
This looks nice. I'm slightly surprised by the error handling though:
if std.type() == "error" then
It seems (a) a bit verbose and (b) a bit hacky to compare the type against the string "error". I wonder if more ergonomic error handling is something the author is planning.
- JNRowe 4y agoThe section on the try operator¹ includes an example showing the syntactic sugar to reduce the verbosity. It does feel like it might be better to introduce it earlier on, as I was feeling the same way as you until I saw that. ¹ https://hush-shell.github.io/error-handling.html#try-operator https://hush-shell.github.io/error-handling.html#try-operato...
- hajile 4y agoDestructuring and a little bit of pattern matching could go a long way here.