From: Phlip Date: 2007-09-29T07:34:20+09:00 Subject: Re: a different type of reference (shocked) SpringFlowers AutumnMoon wrote: > (and in Ruby, we call a method by "pass by value, the value being the > reference (pointer) to an object). and when the method returns > something, it returns a value, which is the reference to an object.) It > is very consistent all the way. In Ruby, we don't have the "alias > reference", right? In Ruby, types that can (generally) fit into 32 bits are "immediate types". These Fixnums and Floats are pass-by-value. All other types - from String up - are pass by reference: def foist(q) q.replace('yo') end q = 'otherwise' foist(q) assert_equal 'yo', q Nothing to be shocked about, because you should not scribble on your input arguments anyway. If you need some other value inside a method, it should get its own variable with a distinct name. -- Phlip http://www.oreilly.com/catalog/9780596510657/ ^ assert_xpath http://tinyurl.com/yrc77g <-- assert_latest Model