From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 7344DBC6C for ; Fri, 18 Jan 2008 01:04:29 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAL57j0fVJFBblmdsb2JhbACQFwEBAQEHBAYHChEHgRScFA X-IronPort-AV: E=Sophos;i="4.25,213,1199660400"; d="scan'208";a="6255119" Received: from mx-out.libertysurf.net (HELO mail.libertysurf.net) ([213.36.80.91]) by mail2-smtp-roc.national.inria.fr with ESMTP; 18 Jan 2008 01:04:29 +0100 Received: from [192.168.1.2] (88.123.244.49) by mail.libertysurf.net (7.3.118.8) id 478BC2F2000F15ED; Fri, 18 Jan 2008 02:02:42 +0100 From: Florent Monnier Organization: l'Association Linux-Nantes To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Give back a Pair from C to OCaml? Date: Fri, 18 Jan 2008 00:58:50 +0100 User-Agent: KMail/1.8.2 References: <1200583973.478f7525e7a5a@webmail.in-berlin.de> <200801172143.55407.fmonnier@linux-nantes.fr.eu.org> <1200608794.478fd61aabcb5@webmail.in-berlin.de> In-Reply-To: <1200608794.478fd61aabcb5@webmail.in-berlin.de> Cc: Oliver Bandel MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200801180058.50904.fmonnier@linux-nantes.fr.eu.org> X-Face: -0"dKXwF0PiXr]fa$^)NJY7$;waqUckGcM7&q,VU?Xv\[=CiVM]g]pDs^xmfU9+Q=Z,OdfMHUR-7Ao%evJh.=aiq,#r0Ux0dm'!l|zeAXj||$>1_(Lv4Hc",&F}sbHeK0`SBA$_|XP Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; ocaml:01 ocaml:01 wosize:01 val:01 emptylist:01 wosize:01 val:01 wrappers:01 int-:01 arrays:01 caml-list:01 pair:01 caml:02 usefull:02 floats:02 Hi, > > Recently I've written a small tutorial about wrapping ocaml to C, > > maybe you could find it usefull: > > http://www.linux-nantes.org/~fmonnier/OCaml/ocaml-wrapping-c.php > > [...] > > You mentioned a "Double_wosize" in your tutorial, > but I can't find such a thing in the reference manual. Yes indeed, the macro Val_emptylist is not either in the manual, but if you read the caml header files, you will find both of these macro. You can safely use both of them in your project. > Possibly you mean something like > Wosize_val(Double_field(ml_array, 0)) > ??? > Would that work? I don't know, I haven't tryed. But for the "Double_wosize" macro, you can trust, I have asked on the other ocaml list, so there's no problem there. And a lot of ocaml wrappers use it. > Does int- and floats really need such a distinction?! Yes, float arrays are not handle in the same way than the other values. (it's explained in the manual.) When I had read this part of the ocaml manual, I haven't found it very easy to understand, so that's why I thought perhaps it is the same for other people, and why I have tryed to make this little tutorial. Regards