[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Goo .NET part 2
I've updated the support for using Goo on .NET. Working now is garbage
collection and examples of calling .NET libraries. For example, the
following code will load an assembly, create an object and call a
method:
-----8<------
(use double/dotnet/system_reflection_assembly)
(use double/dotnet/system_reflection_methodinfo)
(use double/dotnet/system_type)
(use double/dotnet/system_activator)
(dv a (system_reflection_assembly-load-assemblystring "test"))
(dv type (system_reflection_assembly-gettype-name a "MyClass"))
(dv meth (system_type-getmethod-name type "doit"))
(dv obj (system_activator-createinstance-type type))
(system_reflection_methodinfo-invoke-obj-parameters meth obj (list
"test " "one"))
-----8<------
Ugly isn't it. It uses automatically generated wrapper functions from a
program I wrote that uses .NET reflection to query assemblies for their
types and generate the Goo stuff.
I had to resolve things like overloaded method names by appending the
names of the parameters to the Goo method name - otherwise I got
problems with Goo methods having different number of arguments to that
requried by the generic function, etc.
I plan to work on this some more to make it more user friendly but it's
a start.
More info at:
http://radio.weblogs.com/0102385/2002/05/04.html#a96
Chris.
--
http://www.double.co.nz
--
Chris Double
chris.double@double.co.nz