From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id IAA12033; Wed, 29 Sep 2004 08:38:24 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 IAA12733 for ; Wed, 29 Sep 2004 08:38:23 +0200 (MET DST) Received: from sccmmhc92.asp.att.net (sccmmhc92.asp.att.net [204.127.203.212]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id i8T6cMpO007594 for ; Wed, 29 Sep 2004 08:38:22 +0200 Received: from [192.168.0.102] (12-216-206-47.client.mchsi.com[12.216.206.47]) by sccmmhc92.asp.att.net (sccmmhc92) with SMTP id <20040929063821m9200asedue>; Wed, 29 Sep 2004 06:38:21 +0000 Subject: [Caml-list] Primitive sizes From: Jonathan Bryant Reply-To: jtbryant@valdosta.edu To: caml-list@inria.fr Content-Type: text/plain Message-Id: <1096440210.6626.9.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6-2mdk Date: Wed, 29 Sep 2004 02:43:31 -0400 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 415A585E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; floats:01 ignoring:01 interfacing:01 preferable:01 virtues:01 -bit:01 -bit:01 typedef:01 ocaml:01 int:01 int:01 laziness:02 allocate:03 interface:03 perl:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I would like to know the sizes of the "primitive" types in OCaml (I assume that they vary per platform, but one can hope that they are standard...) If they do vary , is there any way to define new types (similar to C typedef macro)? I would like to create 8-, 16-, 32-, and 64-bit integers, 32- and 64-bit floats, and 16-bit characters. I know i could just create Int32s and Int64s and manipulate the bits ignoring the ones I don't need, but is there a way to allocate just the necessary memory without interfacing to C? If not, can anyone point me in a good direction to learn how to interface with C (by "good" I mean that a tutorial is better/more preferable than a language specification...)? --Jonathan Bryant AIM: JonBoy3182 "The three principal virtues of a programmer are Laziness, Impatience, and Hubris." -- Perl man page ------------------- 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