3 ms·
Go's error handling reminds me of the Icon programming language's elegant "goal-directed execution". Icon's control structures use implicit "success/failure" in
by cpeterso 14y ago
Go's error handling reminds me of the Icon programming language's elegant "goal-directed execution". Icon's control structures use implicit "success/failure" instead of true/false boolean logic. For example:
if a := read() then write(a)
read() could return a false or zero value and still "succeed", calling write(a). If read() returns "failure", then write(a) will not be called. (I don't recall what the value of `a` will be in that case.)
https://en.wikipedia.org/wiki/Icon_programming_language#Goal-directed_execution https://en.wikipedia.org/wiki/Icon_programming_language#Goal...
- Evbn 14y agoThat is like return codes in shell.