From: SonOfLilit Date: 2007-01-28T21:56:59+09:00 Subject: Re: pass by reference? ------=_Part_47904_11930450.1169989015494 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline How about: class Vault attr_accessor :unvault def initialize val @unvault = val end end class Object def to_vault Vault.new(self) end end def change_me(obj) obj.unvault += " rocks!" end o = "Ruby".to_vault change_me(o) p o.unvault $ ruby vault-test.rb "Ruby rocks!" On 1/27/07, Andy Koch wrote: > > Hello, > > Is there a way to pass variables by reference into function. > > I have large string to pass and the pass by value seems to be eating up > too much memory. > > Thanks, > > Andy > > > ------=_Part_47904_11930450.1169989015494--