From: dblack@... Date: 2006-08-25T09:01:12+09:00 Subject: Re: do not understand this closure Hi -- On Fri, 25 Aug 2006, rak rok wrote: >> a = 5 >> a() > > This would fail just like a.call() would fail. > > def say >> puts "hello" >> end >> >> say = proc { puts "goodbye" } >> >> say() # hello or goodbye? > > > I would say this would be similar to redefining a method, where the latest > definition takes precedence. That's never going to work. It would quickly become a nightmare of scoping and naming issues. Methods and Procs just aren't at the same level of indirection from their written identifiers. It's better to keep that difference visible. David -- http://www.rubypowerandlight.com => Ruby/Rails training & consultancy ----> SEE SPECIAL DEAL FOR RUBY/RAILS USERS GROUPS! <----- http://dablog.rubypal.com => D[avid ]A[. ]B[lack's][ Web]log http://www.manning.com/black => book, Ruby for Rails http://www.rubycentral.org => Ruby Central, Inc.