From: dblack@... Date: 2007-01-27T21:37:57+09:00 Subject: Re: pass by reference? ---2049402039-392640456-1169901462=:17340 Content-Type: MULTIPART/MIXED; BOUNDARY="-2049402039-392640456-1169901462=:17340" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---2049402039-392640456-1169901462=:17340 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Hi -- On Sat, 27 Jan 2007, Wolfgang N=E1dasi-Donner wrote: > May be it will be clearer to name an assignment "a =3D someobject" by wha= t it=20 > really means: "Give a reference to object 'someobject' a name 'a' by=20 > definition". It's close to the ":=3D" used for definition in mathematics. > > If one uses this "a" as a "reference to 'someobject'" as an actual parame= ter=20 > in a method call, it means, that the "reference to 'someobject'" is actua= lly=20 > used in the method. > > Clearly you cannot change "a", because you don't have access to this name= "a"=20 > inside the method, but you can change the object "someobject" usually wit= hout=20 > any problems. If you change "someobject" this will have consequences for = 'a',=20 > because the object ist changed, the reference is still the same. Right -- I take that as the starting point -- but what I mean is that the way the assignment/rebinding semantics work doesn't necessarily pertain to the reference/value question. David --=20 Q. What is THE Ruby book for Rails developers? A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black) (See what readers are saying! http://www.rubypal.com/r4rrevs.pdf) Q. Where can I get Ruby/Rails on-site training, consulting, coaching? A. Ruby Power and Light, LLC (http://www.rubypal.com) ---2049402039-392640456-1169901462=:17340-- ---2049402039-392640456-1169901462=:17340--