[erlang-questions] EEP 47: Syntax in try/catch to retrieve the stacktrace directly
Björn Gustavsson
bjorn@REDACTED
Mon Nov 27 15:22:49 CET 2017
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.
If we were to implement pattern matching on the
stacktrace, it would be much slower than the
matching the pattern for the exception. I find
that kind of performance trap to be worse
than not allowing matching in the first place.
I have updated the pull request so that there
is now a compilation error if the variable for
the stacktrace is already bound. The compiler
already gives an error if an attempt is made
to use the stacktrace variable in the guard.
Since the compiler is that strict, it would be
a compatible change to implement matching
in the future, if it turns out that is desirable
or reduces user confusion.
/Björn
--
Björn Gustavsson, Erlang/OTP, Ericsson AB
More information about the erlang-questions
mailing list