[erlang-questions] alternate forms for comparisons >= and =<

Richard A. O'Keefe ok@REDACTED
Wed Mar 26 23:44:33 CET 2008


On 26 Mar 2008, at 9:30 pm, Hynek Vychodil wrote:

> http://www.erlang.org/doc/reference_manual/expressions.html#6.11

The operator precedence table in section 6.25
(http://www.erlang.org/doc/reference_manual/expressions.html#prec)
is rather confusing.  The right hand column gives associativity,
using
	"Left associative"
	"Right associative"
	"-"
and	""

Left associative and right associative I understand, but what, if  
anything,
is the difference between "-" and "-" in that column?  Is
	a:b:f(X)
illegal, undefined, or what?  (In Prolog it would be equivalent to  
b:f(X).)

And surely "#" (which also has a "" association) should be left  
associative,
so that X#state.thingy#thingy.whatsit does the right thing?  Ditto for
X#state{thingy=T}#state{whojacky=W}, which I know can be done in one  
step.

Above all, surely "andalso" and "orelse" have *some* kind of  
associativity.

I must say that I find the positions of "and" and "or" in the table
stunningly unintuitive, which gives me added encouragement in my
determination never to use them.




More information about the erlang-questions mailing list