From: Robert Dober Date: 2006-09-26T17:24:48+09:00 Subject: Re: How to copy a method from one class to another ------=_Part_1273_30524952.1159259085784 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 9/25/06, Gavin Kistner wrote: > > > Ruby's methods are not first-class functions like Lua or JavaScript > have. Other, first-class functions exist (procs/lambdas), but Methods > are not these. I tend to disagree, I do not know about Lua, but for me Ruby's methods are pretty much first class class A def a; puts "#{self} =3D=3D 42"; end end class B < A define_method :another_a, A.instance_method(:a) end AA =3D Class.new A A.new.a A.instance_method(:a).bind(AA.new).call B.new.another_a I do not know what can be done more in Lua and JavaScript but would be happ= y to know. Cheers Robert --=20 Deux choses sont infinies : l'univers et la b=EAtise humaine ; en ce qui concerne l'univers, je n'en ai pas acquis la certitude absolue. - Albert Einstein ------=_Part_1273_30524952.1159259085784--