Jonas Bulow <jonas.bulow / servicefactory.se> writes:

>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)

Not a callcc surprise ... more of a transient error in ruby 1.7.0 .

Semantically what you are doing above is valid
   [ Scheme's equivalent would be (call/cc (lambda (k) (set! c k)))]
and it works fine in ruby 1.6.2.

Out of curiosity I tried it on the CVS version and had the same problem.

Seems to be more of an issue with the currently evolving ruby 1.7.0 than
with the irb code as things work fine with ruby 1.6.2 running on the CVS
version of sample/irb.rb

But, as always, it will be fixed by matz in less time than it 
takes to cook an egg ;-)

Regards,
Raja