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

Jakub Groncki jakub.groncki@REDACTED
Mon Apr 10 08:14:51 CEST 2017


I think it would be more than helpful but on the other hand some new users
could say that the shell is buggy because it crashes and restarts for no
good reason...

2017-04-10 6:48 GMT+02:00 Richard A. O'Keefe <ok@REDACTED>:

> Reflecting on this, I know *I* was surprised the first time I
> realised that exceptions crashed and restarted the shell.
> One reason it was surprising was that
> 1> X = 1.
> 1
> 2> Y.
> * 1: variable 'Y' is unbound
> 3> error(goo).
> ** exception error: goo
> 4> X.
> 1
> 5> Y = self().
> <0.37.0>
> 6> error(cthu).
> ** exception error: cthu
> 7> {Y, self()}.
> {<0.37.0>,<0.41.0>}
>
> so that "ports and ETS tables as well as processes linked to
> the evaluator process" don't "survive the exception" in
> contrast to variable bindings, which visibly DO survive.
>
> The case of Y is particularly confusing.
>
> Would it help if restarted shells printed a message
> "Shell restarted: associated ports, ETS tables, and links lost."
> ?
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170410/94322dd6/attachment.htm>


More information about the erlang-questions mailing list