From: Mauricio Fernandez Date: 2006-08-25T04:13:13+09:00 Subject: Re: do not understand this closure On Fri, Aug 25, 2006 at 03:50:31AM +0900, ara.t.howard@noaa.gov wrote: > On Fri, 25 Aug 2006, Mauricio Fernandez wrote: > > >>that said, 1.9 has support for a_proc() > > [...] > >Right now, it's > > > >RUBY_RELEASE_DATE # => "2006-08-13" > >RUBY_VERSION # => "1.9.0" > >a = proc{|x| x+1} > >a.(2) # => 3 > > huh. so '()' is a method name now? nope, it's just sugar standing for #call: RUBY_VERSION # => "1.9.0" RUBY_RELEASE_DATE # => "2006-08-13" a = Object.new def a.call(x); x+1 end a.(2) # => 3 -- Mauricio Fernandez - http://eigenclass.org - singular Ruby