Forum: Ruby RbDynamicMethod first drop

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
drjflam (Guest)
on 2005-12-07 07:06
(Received via mailing list)
I just posted a drop of RbDynamicMethod here:

You'll need a copy of Visual C++ 2005 (probably any edition, but I
tried it on anything other than the Team Edition for Software
Developers) to
compile the sources. I understand that cl.exe (and hopefully its friends
link.exe and mt.exe) ships with the WinFX SDK for those of you who don't
have a copy of Visual Studio 2005. I've provided a Rakefile, so you
need the IDE, just the compiler + linker + manifest tool.

Here's a taste of the syntax in this example that maps CLR exceptions to
Ruby exceptions:

create_ruby_method('convert_clr_exception') do
    ldstr    'error'
    newobj   'Exception.ctor(String)'
  catch_ex   'Exception'
    call     'static ExceptionHelper.RaiseRubyException(Exception)'

It's about 330 lines of C++ and 100 lines of Ruby code.

Comments and suggestions would be *greatly* appreciated!

This topic is locked and can not be replied to.