[erlang-questions] list comprehensions speed

Richard A. O'Keefe ok@REDACTED
Tue Feb 25 22:22:45 CET 2014


On 26/02/2014, at 5:33 AM, Oleg wrote:

> If we can use =:= for the string matching, why does string module contain equal()?

(1) Abstraction.
(2) To have a function that you can pass around.
    There's a nasty little gotcha in Erlang, which I've
    never been able to see the point of.

    In Lisp,    I can use #'EQUAL   to get the equality function.
    "  SML,     " "   "   op =      "  "   "   "        "
    "  Haskell, " "   "   (==)      "  "   "   "        "
    In Erlang,  there is nothing I can use.

    You might expect that fun erlang:'=:='/2 or even
    fun =:= would do the trick.  But it doesn't.  If
    you have a function that takes a two-argument "match"
    predicate, and you want to pass =:= to it, you must
    have a "real" function.

    Off-hand, Erlang is the only functional programming
    language I can recall using in which the built-in operators
    are NOT built-in functions.




More information about the erlang-questions mailing list