From: Robert Dober Date: 2008-01-19T22:24:35+09:00 Subject: Re: passing method references in python & ruby On Jan 19, 2008 1:59 PM, ts wrote: > >>>>> "R" == Robert Dober writes: > > R> I still fail to see the need for this restriction > > Without this restriction you can write > > Array.instance_method(:[]).bind(Hash.new).call(0) > > and if you are not lucky ruby just crash. Bad example of mine, what disturbs me is the following not working: Module::new{ def a; 42 end}.instance_method(:a).bind(Object.new).call not working: a=Modul::new{ def a; 42 end}.i_m :a Object.module_eval{ define_method :x, a } working; module M def m; 42 end end Object.module_eval{ include M define_method :x, M.instance_method(:m) } p Object.new.x and I thought we were all ducktypers :( Robert > > > Guy Decoux > > -- http://ruby-smalltalk.blogspot.com/ --- Whereof one cannot speak, thereof one must be silent. Ludwig Wittgenstein