English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    
Browse thread
[Caml-list] CamlIDL and true abstract types
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Dmitry Bely <dbely@m...>
Subject: Re: [Caml-list] CamlIDL and true abstract types
Lauri Alanko <la@iki.fi> writes:

>> typedef [abstract] void* Foo;
>
> Yes, I read about that, but I consider it a hack, not proper support.

I don't think so. IMHO the support is quite sufficient.

> Since CamlIDL considers Foo completely opaque and doesn't even see that
> it is a pointer, I cannot use pointer-specific attributes such as [ref],
> [unique] and [ignore].

Why do you need these attributes for abstract types? How are you going to
use them? What should they mean?

>  And saying that a type is void* when it really is
> Foo* isn't even strictly legal, the way the stubs are implemented:
> though conversion between void* and T* is legal for all object types T,
> conversion between void** and T** isn't, yet this is the sort of type
> punning that the generated stub code does.

I don't see the real problem here.

1. Conversion that stub funtions perform is always safe.
2. You can compile the stub with your library C headers, and then there
will be no conversion at all, because the original definition of type Foo
will be used:

test.idl
typedef [abstract] void* Foo;

test.h
/* manually written */
#include "foo_native_definition.h"

$ camlidl test.idl

Hope to hear from you soon,
Dmitry


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners