[rdnzl-devel] A question about CAST

Iver Odin Kvello iok at selvaag.no
Thu Apr 26 15:11:32 UTC 2007


> Yes, you'd have to do that at in the C++ code, i.e. create a "copy"
> operation in the DotNetContainer class which copies an existing
> container and returns (a pointer to) the copy.  And export that
> operation so that you can use it from Lisp.  And then make it
> available to Lisp via the FFI.  I /think/ that shouldn't be too hard
> and shouldn't result in any GC problems.

Thank you, I'll have a look.

Also: I just realised that there is a very simple additional workaround:
One could just load in an assembly with a class with a static method

 public static Object Copy(Object o) { return o; }

That worked too; but I've installed a C++ setup anyway to try to
understand things better.

> Of course, if you do that it'd be nice if you could send your
> modifications back to the list so I can include it in a future
> release

We will.

>> and if we use CAST to get this, it is impossible to CAST back to the
>> original interface type.

> I'm probably too dense at the moment, but /why/ can't you just cast
> back?

I don't really know why exactly, but the error given is

  Error: .NET error (System.InvalidCastException): Object must
  implement IConvertible.

Regards,
Iver Odin Kvello
iok at selvaag.no



More information about the rdnzl-devel mailing list