[erlang-questions] call by value

Daniel Dormont dan@REDACTED
Thu May 19 17:43:58 CEST 2011

In my experience with other languages, the difference between call-by-value and call-by-reference is not generally understood to depend on whether the data in memory is physically copied or not. That's really an implementation detail. Rather, the difference is whether the argument "itself" is passed as opposed to its value.

Personally, I consider the distinction meaningless in languages like Erlang (or Haskell, or even, say, SQL) that lack mutable variables.


On May 19, 2011, at 11:36 AM, Martin Dimitrov wrote:

> Hi,
> How will we have to interpret this citation from "Erlang Programming" by
> Francesco Cesarini and Simon Thompson (page 30):
> "All calls with variables in Erlang are call by value: all arguments to
> a function call are evaluated before the body of the function is
> evaluated. The concept of call by reference does not exist, ..."
> I know that variables are not copied when making a function call and are
> copied when sending messages to processes. So why do the authors say all
> calls are call by value? Aren't the function calls actually call by
> reference?
> Regards,
> Martin
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

More information about the erlang-questions mailing list