3 ms·
I believe the difficulty with "pass by reference" is that the phrase implies (at least in other languages) that the function-body can potentially alter variable
by Terr_ 9y ago
I believe the difficulty with "pass by reference" is that the phrase implies (at least in other languages) that the function-body can potentially alter variables in the caller's scope, by assigning something to the parameters it is given.
In other words, "C-style" pass-by-reference means this function would have an undesirable side-effect:
void foo(Thing x){ x = null; }