[erlang-questions] call by value

Richard O'Keefe ok@REDACTED
Fri May 20 11:20:03 CEST 2011


On 20/05/2011, at 3:40 AM, Matthew Sackman wrote:
> Well I think there is a difference of interpretation of the terminology
> based on whether you're in C world or functional world. To me, they're
> more talking about laziness: Erlang is strict and as such expressions in
> arguments to function calls are reduced to terms before the function is
> invoked. I'm not sure that's exactly the same as call by value,

"strict" argument evaluation is precisely call by value.
The terminology used in the original quotation was that of the C++ world
(and others), where
	void foo(int &x) {...}
	... foo(y) ...
passes the *address* of the mutable variable y to foo
so that foo may change it, whereas
	void bar(int x) {...}
	... foo(y) ...
passes the *contents* of the mutable value y to foo.





More information about the erlang-questions mailing list