From: MikkelFJ Date: 2001-12-01T05:57:30+09:00 Subject: [ruby-talk:27123] Re: first class functions in Ruby "Robert Feldt" wrote in message news:Pine.GSO.4.21.0111300609100.10990-100000@godzilla.ce.chalmers.se... > On Fri, 30 Nov 2001, MikkelFJ wrote: > > Something along the lines: > > class Fun .... > end .... sq = Fun.new {|x,y| x*y} > > p aMes(sq[2]) #=> 14 > It's not perfect since arity might surprise sometimes and there are other > issues... But it does solve the problem in a very elegant way. Once the function is created the syntax is rather clean. Adam Spitz 's solution is also interesting because it immediately allow you to do magic on existing messages. MikkelFJ