FYI, I'm (attempting) to port rubydotnetproxy
(http://rubydotnetproxy.rubyforge.org/) to Mono.
So far, I get it to run and pass all my test cases (for Ruby calling
.NET anyway) if I turn Ruby garbage collection off :-) [otherwise it
crashes]
The main problem is dealing with some differences between Microsoft and
Mono implementations of libraries and I had to make a few changes to
Mono to get it to work. (I'll send patches to Mono people later.)
Just letting you guys know in case someone else is working with Mono and
we run into the same bugs.
A non-mono issue I noticed is that in .NET, sometimes the type of a variable is
important when calling methods, as well as the type of the object.
e.g.
interface A {}
interface B {}
class C : A, B {}
class Foo {
public static string hello(A a) {
return "A";
}
public static string hello(B b) {
return "B";
}
}
// ...
C c = new C();
A a = c;
B b = c;
Foo.hello(a); // "A"
Foo.hello(b); // "B"
Foo.hello(c); // wouldn't compile
Hence we need a "cast" interface. I plan to add one called something
like "cast_to" so you can do e.g.
c = C.new
Foo.hello(c.cast_to(A))
This should be easy to do since my implementation of DotNet::Instance
has a type_id and instance_id for each instance, so I will just need to
make a new instance with a different type_id.
--
Tim Sutherland <ti...@ih...>
2004 President of SDKACM, the Software Developers' Klub Incorporated.
This is the University of Auckland ACM Student Chapter and is AUSA affiliated.
See http://www.sdkacm.com/ for information and resources.
|