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

Jesper Louis Andersen jesper.louis.andersen@REDACTED
Sat Nov 25 15:17:27 CET 2017


I think this is a sensible change all in all, and one which should be done.

My major gripe with it is the fact that you cannot pattern match on the
stack trace. I see why this is done, but it feels like being a special
arbitrary rule which goes against other matching patterns in the language.
I'm not sure how it would help

catch
   Cl:Err:Stk ->
        case {Cl, Err, Stk} of
          ...
end

What I really like about the change is that it removes get_stacktrace/0
which is a "bad function", and one of those things I tend to call a
"language mistake" in Erlang[0].

[0] For the interested, I think one of the most obvious mistakes are that a
floating point numbers in Erlang cannot express NaNs and Infinities.

On Fri, Nov 24, 2017 at 10:05 AM Björn Gustavsson <bjorn@REDACTED> wrote:

> There is a new EEP that proposes a new syntax in try/catch to retrieve
> the stacktrace directly without using erlang:get_stacktrace/0:
>
> https://github.com/erlang/eep/blob/master/eeps/eep-0047.md
>
> /Björn
> --
> Björn Gustavsson, Erlang/OTP, Ericsson AB
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20171125/4c80a824/attachment.htm>


More information about the erlang-questions mailing list