[erlang-questions] learning Erlang: factoring primes

ok ok@REDACTED
Mon May 7 04:02:44 CEST 2007


On 4 May 2007, at 11:58 pm, Kostis Sagonas wrote:
> I've seen tons of places in Erlang code where people mean =:=/2 and
> they use ==/2.  In my opinion this bad practice should change.  Also,
> it is really a pity that Erlang does not have proper integer  
> comparison
> operators and all of them (e.g. '>'/2) are overloaded for numbers.

In fact I just made this "mistake" in the improved factorising code I
posted.  My excuse is that Erlang, which came *after* Prolog and which
uses Prolog-based syntax, gets =:= and == completely back-to-front from
the way Prolog has them.  In Prolog, == means "exact identity" and
=:= means "numerically equal after evaluation".  I cannot imagine why
Erlang swapped them.  I keep on tripping up over this.




More information about the erlang-questions mailing list