rb_callcc from c extension: musing

K

Kaspar Schiess

Hello all,

In a sharing mood: Am I the only one who did not see how this can be done ?

Ruby's C API is so elegant, I feel shabby next to it sometimes. I was
trying to get my hands on a continuation from C code lately (for various
reasons that shall not be disclosed publicly, as is often the case with
cc's). Looking up in ruby.h came up with no match for 'callcc', so I
checked in README.EXT (ups should have started there), nothing either.

Looking at eval.c I got disappointed: the thing is declared static
(rb_callcc). Probably for some good reason.

The thing I came up with is this:
http://www.tua.ch/ruby/rubycc/rubycc.html
That couldn't possibly work.

But it actually does. Thank you matz !

kaspar

code manufacture - ruby lab
www.tua.ch/ruby
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top