[erlang-questions] EEP 47: Syntax in try/catch to retrieve the stacktrace directly

Jesper Louis Andersen jesper.louis.andersen@REDACTED
Mon Nov 27 15:31:35 CET 2017


On Mon, Nov 27, 2017 at 3:22 PM Björn Gustavsson <bjorn@REDACTED> wrote:

> On Sat, Nov 25, 2017 at 3:17 PM, Jesper Louis Andersen
> <jesper.louis.andersen@REDACTED> wrote:
> [...]
> >
> > My major gripe with it is the fact that you cannot pattern match on the
> > stack trace.
>
> Yes, I don't like that inconsistency myself, but I
> think that the alternatives are worse.
>
>
Yes, I think so too. In a typed language, you would probably declare an
abstract type for the stack and not provide any kind of matching pattern
for it. This would force people to handle the stack by printing, and there
would be no matching on it at all.

Mimicking this behavior in Erlang is probably the sane behavior in this
case.

I also like Richard's point: matching on the stack will eventually get you
into trouble.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20171127/39be8dcd/attachment.htm>


More information about the erlang-questions mailing list