|
|
|
|
|
by lvh
3341 days ago
|
|
In all of those cases, you're probably passing a reference by value, semantically. ("Probably", because you didn't specify which languages, so I'm making an educated guess.) The usual litmus test is having two objects (or ints or whatever), write a fn `swap(a, b)` where the two are swapped after the call is over. Can't do that in Java or Go or Python or C; but you can in e.g. C++ and you sorta-can in Lisp. In C++, you'd see int& (or whatever) show up in the arguments of swap(). |
|
But in C and Go you can pass pointers to pointers, in Java and Python objects with mutable object references..
It seems like the whole article could have been "Go does not have the C++ reference type, so it's not really in the mix when calling functions".