Hello,

Is there a way to "return" from inside a ruby_exec() call so that a
subsequent call to ruby_exec() will resume execution from the first
instruction after the "return" ?

For example:

1. C program calls rb_load_file() to load some Ruby code

2. C program calls ruby_exec()

3. ruby_exec() runs the Ruby code

4. Ruby code calls a magical "magic_return" method

5. ruby_exec() saves the current Program Counter, Stack Pointer, and
Register File associated with the current point of execution of the
Ruby code

6. ruby_exec() returns (literally, using the "return" keyword in C)

7. C program does some stuff

8. C program calls ruby_exec()

9. ruby_exec() notices that it was previously running some Ruby code
that called the "magic_return" method.  Consequently, ruby_exec()
restores the Program Counter, Stack Pointer, and Register File
associated with the current point of execution of the Ruby code

10. ruby_exec() continues running the Ruby code (starting with the
first instruction after the "magic_return" method call in the Ruby code)

Thanks for your consideration.