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