[rdnzl-devel] C# pointer comparison.

Edi Weitz edi at agharta.de
Sat Mar 15 14:40:01 UTC 2008


On Sat, 15 Mar 2008 11:32:55 +1100, "Matthew O Connor" <matthew.oconnor at calyptech.com> wrote:

> I tried out the code you gave me but it doesn't do the trick. I've
> created some test code to illustrate my problem a bit better. It is
> listed below.
>
> There are two parts to it. You have to build a simple dll which
> contains a class that simply stores a reference passed to it as an
> "object". The lisp code simply instantiates a
> ReferenceComparisonTest object, passes it a reference to itself and
> then later compares what it passed in with what it got back to see
> if they are the same thing.
>
> They should be the same but clearly aren't. I think this is the crux
> of my problem.

Yes, I see now.  I misunderstood your original question.  What you
want is a bit more complicated but certainly doable (I think) and
would probably also be worthwhile to have as a part of RDNZL.  You
need to add new C++ code for this, though.

Look at the DotNetContainer.h and DotNetReference.h files.  A
container has a public function getContainerObject which returns the
object it wraps.  You want to add a C++ function which accepts two
DotNetContainer objects and compares the objects they wrap.  This
function can then be called from Lisp code via the FFI.

I can add that, but it'll take be some time as I'm busy with other
things right now, so feel free to play with this yourself.



More information about the rdnzl-devel mailing list