From: Robert Dober Date: 2008-02-24T23:00:53+09:00 Subject: Re: passing method references in python & ruby On Sun, Feb 24, 2008 at 2:55 PM, Arlen Cuss wrote: > Hi there, > > You can skip the between and do this: > > > >> def add_one(n) > >> n+1 > >> end > => nil > >> [3,6,8].map &method(:add_one) > => [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 -- http://ruby-smalltalk.blogspot.com/ --- Whereof one cannot speak, thereof one must be silent. Ludwig Wittgenstein