caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Dmitry Bely <dbely@mail.ru>
To: caml-list@inria.fr
Subject: Re: [Caml-list] CamlIDL and true abstract types
Date: Fri, 24 May 2002 20:02:33 +0400	[thread overview]
Message-ID: <bsb5jzza.fsf@mail.ru> (raw)
In-Reply-To: <20020518234245.GA473@la.iki.fi> (Lauri Alanko's message of "Sun, 19 May 2002 02:42:45 +0300")

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


      reply	other threads:[~2002-05-24 16:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-17 19:45 Lauri Alanko
2002-05-18  7:03 ` Dmitry Bely
2002-05-18 23:42   ` Lauri Alanko
2002-05-24 16:02     ` Dmitry Bely [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bsb5jzza.fsf@mail.ru \
    --to=dbely@mail.ru \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).