[erlang-questions] How about a new warning? Was: Re: trouble with erlang or erlang is a ghetto

Thomas Lindgren thomasl_erlang@REDACTED
Wed Aug 3 17:05:57 CEST 2011



>From: Joe Armstrong <erlang@REDACTED>
...
>Actually I like things as they are. My eye is trained to see bound and
>free occurrences of a variable.
>
>On the other hand it would be *excellent* if the color coding in emacs
>(whatever) was changed to reflect the
>binding status of a variable.
>
>If variables in the LHS of an equals were colored green if they were
>unbound and red
>if bound then one would see at a glance what was intended.
>
>(( assuming you're not red-green color blind that is )) - or set the
>variables in a different type face.


This raises the question of whether the order of matching variables is well-defined?

I'm thinking of things like (order inside pattern):

f(A) -> {X, X} = A, X.

or (order of argument matching):

same([X|Xs], [X|Ys]) -> same(Xs, Ys);
same([], []) -> true;
same(_, _) -> false.

I seem to recall that Mike Williams wanted a fully determined evaluation order long ago, for the Erlang spec. Was this implemented? And did it extend to pattern matching?

Best,
Thomas




More information about the erlang-questions mailing list