4 ms·
> Erlang for example follows that pattern (and has no concept of "exception"). Erlang absolutely has a concept of exceptions. They're even called exceptions: h
by masklinn 8y ago
> Erlang for example follows that pattern (and has no concept of "exception").
Erlang absolutely has a concept of exceptions. They're even called exceptions: http://erlang.org/doc/reference_manual/errors.html#exceptions http://erlang.org/doc/reference_manual/errors.html#exception....
- colanderman 8y agoWow, I used Erlang extensively a few years ago and don't remember exceptions at all. (Exit reasons and process monitors, yes; but I don't think I ever wrote a "catch" expression, or encountered a library that expected me to do so.)
- masklinn 8y agoYeah it's very rare to catch exception within processes, or to raise them explicitly. It's common to write something like {ok, Result} = foo() though, and that raises badmatch if it fails, and you handle it in a supervisor.
- rs86 8y agoYou can use throw/catch to great effect when you need non local returns