by xtrapolate · 8y ago · 0 comments
"Alias" means nothing to a CPU, nor is it an ABI. At the core, passing by reference is usually implemented by providing the "address-of" something to a function (for example). The "address-of" itself, is passed by value. Going by that logic, everything everywhere is passed by value.
But the language isn't defined in terms of a CPU. It's defined in terms of abstract semantic rules. You shouldn't think about implementation, especially at the CPU level, when talking about semantics.
The idea is that the alias is implicit in pass-by-reference. It isn't implicit in pass-by-value. How you implement that alias is irrelevant for discussion at this level.
I disagree. I submit the whole reason we pass objects by reference or by value in the first place, has much more to do with conserving computational resources/reducing runtime, than with providing abstract programming semantics for software developers.
(With the exception of primitives. I guess that's the real rub -- Java's special casing of primitive values.)
By the way, there is at least one additional difference in languages like Python and JavaScript with dynamic variable (not value) scope. In those languages, you can `delete` a variable, which removes the binding from the scope. Pass-by-reference would mean that you could delete a variable from a non-local scope if the variable were passed by reference. (This is not the case; `delete` in these languages merely deleted the local variable binding, as it ought, given that they are pass-by-value.)
Who died and made you secretary of the Académie anglaise? Language is defined by consensus; a word means x only to the extent that it is understood to mean x by both the sender and the receiver. This whole thread makes it pretty clear that "pass-by-reference" does not draw the distinction that you think it draws; if you want to draw those distinctions, find words that clearly draw those distinctions. Words are tools for communication, not ends in themselves.
https://courses.washington.edu/css342/zander/css332/passby.h...
I mean, it's not hard to take a look at what was already decided.
English language usage has no bearing on technical terms, your snark notwithstanding.