4 ms·
> The term you are looking for is "pass by reference". Nope, just parameter declarations. I also kind of doubt the by-value semantics will surprise anyone the
by cygx 6y ago
> The term you are looking for is "pass by reference".
Nope, just parameter declarations. I also kind of doubt the by-value semantics will surprise anyone the way you describe: If you pass things by value without explicitly taking a reference, the structure (arrays and hashes, specifically) will be flattened into the argument list. If you're unaware of this, things will probably go wrong long before you've had time to be surprised by stuff getting copied...
- jandrese 6y agoIt can certainly catch C programmers who are used to arrays devolving to pointers in the background when passed as parameters.