From: Robert Dober Date: 2008-02-25T00:13:33+09:00 Subject: Re: passing method references in python & ruby On Sun, Feb 24, 2008 at 3:05 PM, Gregory Marton wrote: > Robert Dober wrote: > > On Sun, Feb 24, 2008 at 2:55 PM, Arlen Cuss wrote: > > >> => [4, 7, 9] > >> > >> Personally, I like doing it this way. You could always try monkey-patching > >> (ooh, buzzword) Symbol by adding Symbol#to_proc to do some method > >> resolution. > > Oh you might do this even very often if you are writing Ruby1.8/1.9 > > agnostic libraries. > > Cheers > > Robert > > Could you both elaborate? I'm not sure what it would mean to > "monkeypatch" this, or which differences with 1.9 will require it. > Thanks already: this is a bit C-like, but nicer than wrapping a block > around things. > Symbol#to_proc exists in Ruby1.9 standard, if you want to have programs run in Ruby1.8 too you will be forced to define your Symbol#to_proc yourself. But I guess that I am wrong that you have to do that often, that was written with very little thinking done :(. Robert > > > Grem > -- > Posted via http://www.ruby-forum.com/. > > -- http://ruby-smalltalk.blogspot.com/ --- Whereof one cannot speak, thereof one must be silent. Ludwig Wittgenstein