3 ms·
I think Zig's error handling is even better: https://ziglang.org/#toc-A-fresh-take-on-error-handling https://ziglang.org/#toc-A-fresh-take-on-error-handling Re
by Kolja 6y ago
I think Zig's error handling is even better: https://ziglang.org/#toc-A-fresh-take-on-error-handling https://ziglang.org/#toc-A-fresh-take-on-error-handling
Return values are a pair of an error value (internally basically an enum) and a result value. Error handling is mandatory, but passing errors to the caller from a nested function can be done by prefixing with `try`.
IIRC, Swift is similar.