[erlang-questions] Shell pid changes after an error occurred

Jakub Groncki jakub.groncki@REDACTED
Sun Apr 9 22:56:49 CEST 2017


Oh wow, this is neat, I would have never guessed, thank you :)

2017-04-09 22:53 GMT+02:00 Loïc Hoguin <essen@REDACTED>:

> Before running your error command, try:
>
> catch_exception(true).
>
> http://erlang.org/doc/man/shell.html#catch_exception-1
>
>
> On 04/09/2017 09:46 PM, Jakub Groncki wrote:
>
>> Hi,
>>
>> My first message here so it may be very n00b but well, I just started to
>> pick up some Erlang a couple of days ago (I'm halfway through
>> "Introducing Erlang" + I find this book quite enjoyable). So there's
>> this one thing that's been bugging me ever since I learnt about
>> processes, pids and the like - the shell pid seems to change after an
>> error caused by malformed code or after a user exception is thrown. See
>> this terminal session snippet:
>>
>> Erlang/OTP 19 [erts-8.3] [source] [64-bit] [smp:2:2] [async-threads:10]
>> [hipe] [kernel-poll:false]
>>
>> Eshell V8.3  (abort with ^G)
>> 1> self().
>> <0.58.0>
>> 2> error(sadface).
>> ** exception error: sadface
>> 3> self().
>> <0.61.0>
>>
>> So here you can see self() yields different values. Does anybody know
>> why it happens the way it happens?
>>
>> PS Of course I'm not implying there's something wrong with this kind of
>> behavior but still it's really interesting.
>>
>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
> --
> Loïc Hoguin
> https://ninenines.eu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170409/37f4ecee/attachment.htm>


More information about the erlang-questions mailing list