[ANN] RbDynamicMethod first drop

J

John Lam

------=_Part_24864_22829473.1133931661557
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

I just posted a drop of RbDynamicMethod here:
http://www.iunknown.com/articles/2005/12/06/first-drop-of-rbdynamicmethod

You'll need a copy of Visual C++ 2005 (probably any edition, but I haven't
tried it on anything other than the Team Edition for Software Developers) t=
o
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 don't
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
try
ldstr 'error'
newobj 'Exception.ctor(String)'
throw_ex
catch_ex 'Exception'
call 'static ExceptionHelper.RaiseRubyException(Exception)'
end_try
ldc_i4_4
ret
end

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

Comments and suggestions would be *greatly* appreciated!

Thanks,
-John
http://www.iunknown.com

------=_Part_24864_22829473.1133931661557--
 

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

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,248
Latest member
MagdalenaB

Latest Threads

Top