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.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 18AF5BC0B for ; Sun, 31 Dec 2006 04:31:35 +0100 (CET) Received: from ipmail02.adl2.internode.on.net (ipmail02.adl2.internode.on.net [203.16.214.141]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id kBV3VW6j014129 for ; Sun, 31 Dec 2006 04:31:34 +0100 Received: from ppp14-213.lns2.syd7.internode.on.net (HELO rosella) ([59.167.14.213]) by ipmail02.adl2.internode.on.net with ESMTP; 31 Dec 2006 14:01:29 +1030 X-IronPort-AV: i="4.12,222,1165152600"; d="scan'208"; a="66080287:sNHT21749581" Subject: Re: [Caml-list] ANNOUNCE : libsndfile-ocaml alpha From: skaller To: Erik de Castro Lopo Cc: Vu Ngoc San , caml-list@yquem.inria.fr In-Reply-To: <20061231080756.66e89d6c.mle+ocaml@mega-nerd.com> References: <20061222155407.ebe6c272.mle+ocaml@mega-nerd.com> <45923DC2.9000504@ujf-grenoble.fr> <20061227211046.656615d0.mle+ocaml@mega-nerd.com> <20061231080756.66e89d6c.mle+ocaml@mega-nerd.com> Content-Type: text/plain Date: Sun, 31 Dec 2006 14:31:25 +1100 Message-Id: <1167535885.27287.66.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 45972F14.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; interfacing:01 ocaml:01 ocaml:01 bigarray:01 elt:01 sourceforge:01 wrote:01 abstract:01 caml-list:01 ints:01 data:02 caml:02 caml:02 floats:02 floats:02 On Sun, 2006-12-31 at 08:07 +1100, Erik de Castro Lopo wrote: > The trouble interfacing with Ocaml is that Ocaml doesn't support > 16 bit shorts, 32 bit ints or 32 bit floats. The only data type that > makes any sense is the Ocaml float type (C double). > > So, I'd like to ask, if I provide a bigarray interface, how would it > be used? >>From the manual: type ('a, 'b) kind To each element kind is associated a Caml type, which is the type of Caml values that can be stored in the big array or read back from it. This type is not necessarily the same as the type of the array elements proper: for instance, a big array whose elements are of kind float32_elt contains 32-bit single precision floats, but reading or writing one of its elements from Caml uses the Caml type float, which is 64-bit double precision floats. The abstract type ('a, 'b) kind captures this association of a Caml type 'a for values read or written in the big array, and of an element kind 'b which represents the actual contents of the big array. The following predefined values of type kind list all possible associations of Caml types with element kinds: -- John Skaller Felix, successor to C++: http://felix.sf.net