From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id MAA27929 for caml-red; Mon, 26 Jun 2000 12:22:01 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA30482 for ; Fri, 23 Jun 2000 18:01:05 +0200 (MET DST) Received: from pop3.dassault-aviation.fr (pop3.dassault-aviation.fr [62.161.178.177]) by nez-perce.inria.fr (8.10.0/8.10.0) with ESMTP id e5NG15X01956 for ; Fri, 23 Jun 2000 18:01:05 +0200 (MET DST) Received: from rnis.dassault-aviation.fr ([193.106.72.203]) by pop3.dassault-aviation.fr (Netscape Messaging Server 3.6) with ESMTP id AAA1F59; Fri, 23 Jun 2000 18:04:05 +0200 Received: from dassault-aviation.fr by rnis.dassault-aviation.fr (8.8.8+Sun/SMI-SVR4) id RAA01195; Fri, 23 Jun 2000 17:59:11 +0200 (MET DST) Message-ID: <39538AD9.727CF77D@dassault-aviation.fr> Date: Fri, 23 Jun 2000 18:05:45 +0200 From: "thierry BRAVIER" Organization: Dassault Aviation X-Mailer: Mozilla 4.08 [fr] (WinNT; I) MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: Unsigned int ?! References: <87pupigd8k.fsf@beepbeep.dev33.cvf> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by rnis.dassault-aviation.fr id RAA01195 Sender: weis@pauillac.inria.fr Luc MAZARDO a =E9crit: > I would like to get the "caml unsigned int value" of an "unsigned int C > value". Is there a way to do this ?? > > I do the following, and it fails ... > > ---toto_stub.c--- > value toto(void) > { > return Val_int(get()); > } > ------------ I think you should add: value toto_external (value unit) { /* unit is necessary for this externa= l function */ return toto (); } > ---toto.mli--- > val toto : unit -> int ;; > ------------ > > ---toto.ml--- > external toto : unit -> int =3D "toto";; Here you would rather write: external toto : unit -> int =3D "toto_external";; Anyway whether your version fails, returns a wrong result or anything els= e cannot be predicted since it is related to the function call protocol of your machine. Or maybe I am wrong since I did not try this on my computer :-) Hope this helps. Thierry Bravier