Category talk:Ruby: Difference between revisions

m
no edit summary
No edit summary
mNo edit summary
Line 69:
:People tend to point out that if these objects are mutable (e.g. String in Ruby), then it is possible to use its mutation methods to mutate its internal state in a way that is visible to other people who have a reference to the same object; but this is irrelevant. Because it is not the object that is being passed -- it is the reference. We can separate out the mutation issue by using an object type that is not mutable, e.g. take an integer or float or boolean in Ruby, and passing it; see that you cannot affect it in the calling scope; whereas in a true pass-by-reference language, you always can. --[[User:Spoon!|Spoon!]] 07:01, 11 August 2011 (UTC)
::That said, note that this point of view is that you cannot pass an object to a method. --[[User:Rdm|Rdm]] 12:33, 11 August 2011 (UTC)
:::Right; not only can you not pass an object, the point of view is that no expression in the language has the value of an object, only the value of a reference. TheThis is the same point of view as in Java, Python, etc. Whatever we decide has to be consistent across all these languages. --[[User:Spoon!|Spoon!]] 19:44, 11 August 2011 (UTC)
Anonymous user