From: Jonas Bulow Date: 2001-02-01T17:24:27+09:00 Subject: [ruby-talk:10207] Re: POLS question: returning from a closure Another callcc surprise is: irb(main):001:0> c=nil nil irb(main):002:0> callcc{|c|} nil irb(main):003:0> c.call nil /usr/local/lib/ruby/1.7/irb/ruby-lex.rb:229: [BUG] Segmentation fault ruby 1.7.0 (2001-01-23) [i386-freebsdelf4.2] Abort (core dumped) Don't ask me what my intention was! :-) /j David Alan Black wrote: > > Hello -- > > Something which did surprise me quite a bit: > > def rtest > pr = Proc.new do > return "Returning from closure" > end > > pr.call > return "Returning from rtest" > end > > puts rtest # "Returning from closure" > > __END__ > > (Tested on ruby 1.6.2 (2001-01-18) [i586-linux].) > > Does that strike anyone else as unexpected? > > David > > -- > David Alan Black > home: dblack@candle.superlink.net > work: blackdav@shu.edu > Web: http://pirate.shu.edu/~blackdav