Thomas Lindgren thomasl_erlang@REDACTED
Wed Oct 22 09:52:47 CEST 2003

--- Richard Carlsson <richardc@REDACTED> wrote:
> To put it short: Erlang exceptions carry more
> information
> than most people think, and the old "catch" just
> wasn't
> constructed with this in mind - it destroys most
> distinctions.
> (One could say that it presents a very simple model
> to the user, by lying about the details.)

(This suggests a pretty dark corner in Erlang's

My main gripe with exceptions is that they don't
provide enough information. At least to the
programmer. When I get a 'badarg', I'd also like to
know where it occurred and what caused it, for

Something like 'smart_exceptions' in jungerl provides
a stopgap solution, but a VM solution would be far
more satisfying.

Here is a way that 'try' could add a bit more value:

- exceptions are "objects" that provide lots of info
on why and where they occurred (module, function,
line, reason, involved terms, etc etc)

- 'catch' strips this info and presents just the

- 'try' provides the entire exception object AND some
way to interrogate it (e.g., suitable match notation,
up to and including "all_properties"). 

- Note that if one can't match the exception per se,
just its properties, then there is no need to make
exception objects a new type either.


Do you Yahoo!?
The New Yahoo! Shopping - with improved product search

More information about the erlang-questions mailing list