From: dave.burt@... Date: 2005-05-06T14:09:26+09:00 Subject: Re: object reference handle (like perl's reference to scalar) > Can someone give me an example of a time you need an extra level of indirection? A reference can sort of replace itself with another object. An Integer is immutable, but a reference to an integer can be changed to any other object. a = [1, 2, 3].map {|i| i.ref } a.each {|i| i[] = 5.1 if i == 2 end Something analogous to the above might be better (clearer?) than #map or #each_with_index in some cases. This also could be used to increase the "mutability" of other objects. IOs could become StringIOs. Instances of singleton classes could become instances of normal classes. class Ref def revert_type_to_class! __setobj__(__getobj__.dup) end end And then, how about a dynamic class reference (or other evil variable constants)? MyClass = Array.ref #... MyClass[] = Hash Cheers, Dave