English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Primitive sizes
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-09-29 (06:38)
From: Jonathan Bryant <jtbryant@v...>
Subject: [Caml-list] Primitive sizes
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