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

Richard A. O'Keefe ok@REDACTED
Mon Apr 10 06:48:41 CEST 2017

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.
2> Y.
* 1: variable 'Y' is unbound
3> error(goo).
** exception error: goo
4> X.
5> Y = self().
6> error(cthu).
** exception error: cthu
7> {Y, self()}.

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."

More information about the erlang-questions mailing list