Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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 <> 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:

typedef [abstract] void* Foo;

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

$ camlidl test.idl

Hope to hear from you soon,

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: