On 3/19/2013 9:56 AM, Rob Pike wrote:
> In Go, everything is passed by value. Everything.
One can say that of all programming languages. At
the bottom, something is passed by value. But sometimes
it's a pointer or a reference that goes on the stack
or in a register. That's generally considered to be
a pass by reference. See
http://en.wikipedia.org/wiki/Evaluation_strategy#Call_by_reference
> There are some types (pointers, channels, maps, slices) that have
> reference-like properties, but in those cases the relevant data
> structure (pointer, channel pointer, map header, slice header) holds
> a pointer to an underlying, shared object (pointed-to thing, channel
> descriptor, hash table, array); the data structure itself is passed
> by value. Always.
>
> Always.
From Wikipedia:
"in the Java community, they say that Java is pass-by-value, whereas in
the Ruby community, they say that Ruby is pass-by-reference, even though
the two languages exhibit the same semantics."
From "Through the Looking Glass":
"When I use a word," Humpty Dumpty said, in rather a scornful tone, "it
means just what I choose it to mean�neither more nor less."
"The question is," said Alice, "whether you can make words mean so many
different things."
"The question is," said Humpty Dumpty, "which is to be master,
that's all."
John Nagle