[erlang-questions] How about a new warning? Was: Re: trouble with erlang or erlang is a ghetto
Ulf Wiger
ulf.wiger@REDACTED
Wed Aug 3 19:05:26 CEST 2011
According to the Barklund spec (page 62), it said that "a compiler must only accept a program if for any evaluation order, there will not be an applied occurrence of an unbound variable".
"For example, in a context where X is unbound, the expression (X=8) + X should give a compile-time error."
(And it does, too. I checked).
BR,
Ulf W
On 3 Aug 2011, at 18:17, Richard Carlsson wrote:
>> And did it extend to pattern matching?
>
> No, there was never any discussion about that. If the match succeeds then it would succeed no matter what the order, and if a you get a 'badmatch' error, the entire matched term is blamed, not just the first subterm that doesn't match, so I can't see that there would be any observable difference depending on the order of matched subterms.
Ulf Wiger, CTO, Erlang Solutions, Ltd.
http://erlang-solutions.com
More information about the erlang-questions
mailing list