From: Sam Roberts Date: 2008-05-07T14:48:34+09:00 Subject: Re: delegation question, where I want prototype style delegation On Tue, May 6, 2008 at 7:25 AM, ara.t.howard wrote: Ara, thanks for the suggestion. It suffers from the same non-stackability problem: p ((a/Reverse)/Reverse).each{} => [4,2] However, the combination of this and James' suggestion made me think maybe I should be cloning my src object, and then modifying it. clone() will get the singleton class, but won't do a deep copy, so it will still share most of the internal state of the original class. I think this will work for me: Classes defined as in my original, but do the extending like: o = Base.new(1..3) n = o.clone.extend Negate.dup an = n.clone.extend Add.dup nan = an.clone.extend Negate.dup puts o.show puts n.show puts an.show puts nan.show % ruby m.rb show: 1,2,3, show: -1,-2,-3, show: 9,8,7, show: -9,-8,-7,