From: ara.t.howard@... Date: 2007-04-21T05:04:53+09:00 Subject: Re: once modifier (pickaxe book page 391) On Sat, 21 Apr 2007, ChrisKaelin wrote: > > ara.t.how...@noaa.gov wrote: > >> one possible reason >> >> >> harp:~ > cat a.rb >> require 'once' >> class NotRobust >> def foo() p 42 end >> once :foo >> end >> >> nr = NotRobust.new >> 2.times{ nr.foo } >> >> >> harp:~ > ruby a.rb >> 42 >> >> >> >> harp:~ > cat a.rb >> require 'once' >> class NotRobust >> def foo() p 42 end >> 2.times{ once :foo } >> end >> >> nr = NotRobust.new >> 2.times{ nr.foo } >> >> >> harp:~ > ruby a.rb >> Segmentation fault (core dumped) >> >> >> harp:~ > ruby --version >> ruby 1.8.4 (2005-12-01) [i686-linux] >> >> regards. >> >> -a > whoops, o.k. I see... > but... why should I do this: 2.times { once :foo } ? o.k. I can > imagine, ruby should allow everything without coredumping ;-) > > -a -- be kind whenever possible... it is always possible. - the dalai lama