[rdnzl-devel] A question about CAST

Iver Odin Kvello iok at selvaag.no
Wed Apr 25 07:33:39 UTC 2007

We've recently started using RDNZL for integration between an internal
application written in ACL 7.0 and a CAD system using a .Net-based
extension-layer in the latter; using .Net Remoting for communicating
between the two systems. We've found that RDNZL works robustly, reliably
and is very easy to use. Thank you very much for creating it.
I have a question with regards to the action of the CAST operator:
Currently, when CAST'ing from one .Net class to another, the
type of the container is destructively updated; and there doesn't seem 
to be any way of copying a container so that a reference to the same 
object but with another type can be created.  That is, I'd like to do
something like
   (cast foo "SomeType"))
   (setq bar (copy-container foo))
   (cast bar "SomeOtherType"))
without the last operating also setting the type of FOO 
to SomeOtherType [1]
Is there some idiom that would work like this that I've missed? If
not, I guess the functionality would have to be added at the C++
level, which I haven't really looked at yet. Any pointers would be

Iver Odin Kvello
iok at selvaag.no
[1] The actual situation that came up was this: We have a remote
 object - actually a transparent proxy - of an interface-type WALL,
 and we need to get a reference to its lease. However, to to this we
 must cast the object to MarshalByRefObject, and if we use CAST to get
 this, it is impossible to CAST back to the original interface
 type. We did find a workaround: using
 System.Runtime.Remoting.RemotingServices.GetRealProxy, another copy
 of the transparent proxy is easily obtained, and that can be cast to
 a MBRO instead. But a copy/cast-operator would have been nicer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/rdnzl-devel/attachments/20070425/35aea519/attachment.html>

More information about the rdnzl-devel mailing list