From: Mike Sassak Date: 2002-02-23T16:29:24+09:00 Subject: Re: TRW: block call question Yup. See http://www.rubycentral.com/book/ref_c_proc.html#Proc._ob_cb -mike On Fri, 2002-02-22 at 19:54, Jos Backus wrote: > Page 282 of TRW has the following example: > > > def take_block(a, &block) > puts block.type > a.times {|i| block[i, i*i]} > end > > take_block(3) {|n,s| puts "#{n} squared = #{s}"} > > This example also shows the use of braces ({}) as an alias for the call > method. > > > Now am I correct in assuming that what was really meant here was ``brackets > ([])'' instead, the equivalent using call being > > a.times {|i| block.call(i, i*i)} > > ? > > -- > Jos Backus _/ _/_/_/ Santa Clara, CA > _/ _/ _/ > _/ _/_/_/ > _/ _/ _/ _/ > josb@cncdsl.com _/_/ _/_/_/ use Std::Disclaimer;