Suppose I assign some functions to variables and compare them like this:<br><br>1> F1 = fun(X) -> X + 1 end.<br>#Fun<erl_eval.6.49591080><br><br>2> F2 = fun(X) -> X + 1 end.<br>#Fun<erl_eval.6.49591080>
<br><br>3> F3 = fun(X) -> X + 2 end.<br>#Fun<erl_eval.6.49591080><br><br>4> F1 =:= F2.<br>true<br><br>5> F1 =:= F3.<br>false<br><br>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.
<br><br>Thanks.<br><br>