[Ironruby-core] More Interop Qs (Out, Ref and Structs)

Tomas Matousek Tomas.Matousek at microsoft.com
Tue Jun 9 13:30:11 EDT 2009

Could you be more specific? It's not helpful if you just say "it doesn't work". Can you include code that you are trying to run and the exact result you get?

Out parameters are returned in a CLR object array as a return value:

has_value, value = dictionary.try_get_value("foo")


-----Original Message-----
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shay Friedman
Sent: Tuesday, June 09, 2009 9:02 AM
To: ironruby-core at rubyforge.org
Subject: [Ironruby-core] More Interop Qs (Out, Ref and Structs)

Hi there,

I've got a few more questions regarding interop scenarios:

1. What happens with out parameters in methods? Currently when I try to
use them I get an error:
:0: can't convert String into
System::Runtime::CompilerServices::StrongBox[System::String] (TypeError)

2. What happens with ref parameters? it doesn't throw an error but it
doesn't change the value as well.

3. Structs - they are mapped to Ruby classes, but I can't create new
instances of them using the new method. How should it be done?

Thanks and sorry for the question flood :)
Follow me: http://twitter.com/ironshay
Posted via http://www.ruby-forum.com/.
Ironruby-core mailing list
Ironruby-core at rubyforge.org

More information about the Ironruby-core mailing list