[erlang-questions] pass-by-reference...

tsuraan <>
Sun Apr 15 15:52:52 CEST 2007


According to the book Programming Erlang (I'm pretty sure, although I can't
find the reference anymore), function arguments are always pass-by-value
unless they're binary types.  Only binaries are pass by reference.  Why is
this?  Erlang is purely functional, so it seems that passing a reference to
a list of ten thousand integers would be perfectly safe, and much more
efficient than copying the list and then calling the function with the
copied data.  Is there some danger in giving references to data rather than
making copies?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20070415/6c85301b/attachment.html>


More information about the erlang-questions mailing list