[erlang-questions] clarify: How are functions assigned to variables compared in Erlang?

Bjorn Gustavsson bjorn@REDACTED
Thu Dec 13 08:24:29 CET 2007


"Juan Jose Comellas" <juanjo@REDACTED> writes:

> Suppose I assign some functions to variables and compare them like this:
> 
> What is the Erlang VM doing when it executes these comparisons? Does is
> compare the bytecode of each function or does it compare them using some
> kind of unique identifier? What I'm trying to determine is the cost of
> comparing two functions assigned to variables.

The Erlang VM does not compare the code of the functions; it compares
unique identifiers.

It also compares the environment of the funs. 

/Bjorn
-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list