principle of least surprise

Martin Bjorklund mbj@REDACTED
Wed Nov 23 08:29:45 CET 2005


Robert Virding <robert.virding@REDACTED> wrote:
> I quite honestly don't really see the problem with the precedences. 

Sorry, that referred to the obfuscation contest at euc.   The problem
can be summarized by this:

    if 1 == 1 or is_integer(1) ->
           erlang:display("is_integer"),
       true ->
           erlang:display("else")
    end.


> Whatever is wrong with your macro it isn't the precedences. How do you 
> envisage that (size(X) == 2) be false? What should size of something 
> usizable return?

No you're right.  Evaluation order is the answer.


/martin



More information about the erlang-questions mailing list