From: Florian Frank Date: 2003-09-11T18:49:24+09:00 Subject: Re: Extract methods in a class to mixin? On 2003-09-10 22:48:24 +0900, ts wrote: > Try this > > Mixin1 = Array.mixin(:[]=) > class B > include Mixin1 > end > a = B.new > a[12] = 24 Line 23 ^^^ > p a It doesn't work - I'm getting the same error as before (in the unpatched ruby version): bash-2.05a$ ruby mixin.rb mixin.rb:23:in `[]=': bind argument must be an instance of Array (TypeError) from mixin.rb:23 The problem is that the []= method remembers the class, that it was bound to before, and a type error is raised. -- The liberty of a democracy is not safe if the people tolerate the growth of private power to a point where it becomes stronger than their democratic State itself. That, in its essence, is Fascism -- ownership of government by an individual, by a group, or any controlling private power. -- Franklin D. Roosevelt