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

Attila Rajmund Nohl attila.r.nohl@REDACTED
Mon Nov 27 16:08:47 CET 2017


2017-11-27 15:31 GMT+01:00 Jesper Louis Andersen
<jesper.louis.andersen@REDACTED>:
> 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.

If the stack trace is strictly for human consumption, why not return a
string (list or binary)?



More information about the erlang-questions mailing list