From: michael libby Date: 2002-01-24T20:50:18+09:00 Subject: Re: Easy references in Ruby? --=.Dvic+SL9g?6Auo Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit (on Thu, 24 Jan 2002 19:55:58 +0900) Olivier CARRERE wrote: > Actually, this does not produce what I wanted to do. > Here is an example of what I would expect : > a="thingy" > b=a.reference > b+="thing" > p a # => would print "thingything" > Is there any way to do it? You don't really need a reference with Ruby's built-in aliasing do you? And + might not be the method you want here. But this is what works for me: $ irb irb(main):001:0> a = 'thingy' "thingy" irb(main):002:0> b = a "thingy" irb(main):003:0> b << 'thing' "thingything" irb(main):004:0> p a "thingything" nil ______Michael_C_Libby__{_x_(at)_ichimunki_(dot)_com_}______ | "even monkeys fall from trees" : "saru mo ki kara ochiru" | | public key at http://www.ichimunki.com/public.key | |_Fingerprint: D946FE20 79EE2109 161BFAFB E02956F4 A330AA73_| --=.Dvic+SL9g?6Auo Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8T/R74ClW9KMwqnMRAis0AJ9tDuqExNhn+VN3UmCYAApHnd8HmwCdE15q Luks5Dd7fnq4EKvQ7C+P5M8= =3bvj -----END PGP SIGNATURE----- --=.Dvic+SL9g?6Auo--