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 VAA00591; Mon, 28 Apr 2003 21:15:59 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA00573 for ; Mon, 28 Apr 2003 21:15:58 +0200 (MET DST) Received: from woodstock.1969.ws (64-215-156-42.eosinc.net [64.215.156.42]) by concorde.inria.fr (8.11.1/8.11.1) with SMTP id h3SJFvH18011 for ; Mon, 28 Apr 2003 21:15:57 +0200 (MET DST) Received: (qmail 16252 invoked from network); 28 Apr 2003 18:56:47 -0000 Received: from karl.1969.ws (HELO 1969.ws) (10.3.2.15) by woodstock.1969.ws with SMTP; 28 Apr 2003 18:56:47 -0000 Message-ID: <3EAD7F33.4080402@1969.ws> Date: Mon, 28 Apr 2003 12:21:23 -0700 From: Karl Zilles Organization: 1969 Communications, Inc. User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 CC: OCaml List Subject: Re: [Caml-list] Looking for a real array References: <200304282151.52240.exa@kablonet.com.tr> In-Reply-To: <200304282151.52240.exa@kablonet.com.tr> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; caml-list:01 eray:01 ozkural:01 unboxed:01 bigarrays:01 implemented:01 demoted:01 interfacing:01 pointers:01 floats:01 arrays:01 tagged:01 ocaml:01 int:01 float:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Eray Ozkural wrote: > On Monday 28 April 2003 21:43, Brian Hurt wrote: > >> I may be confused, but I thought integers were unboxed in arrays (not >> BigArrays, just arrays). Unless you mean references to integers? >> > > > Okay, I might be a little confused, forgive me. I thought, implementation wise, when I say > let a = [| 6, 3, 5, 7, 8 |] > it's implemented by ocaml as > int** a; > in C speak. > > Right or wrong? (Fearing that I might be demoted to beginner status now :P ) > In the "Interfacing with C" section of the manual: --- 18.3.3 Arrays Arrays of integers and pointers are represented like tuples, that is, as pointers to blocks tagged 0. They are accessed with the Field macro for reading and the modify function for writing. Arrays of floating-point numbers (type float array) have a special, unboxed, more efficient representation. These arrays are represented by pointers to blocks with tag Double_array_tag. They should be accessed with the Double_field and Store_double_field macros. --- So it looks like the standard ocaml 31 bit integers arrays are unboxed, as are floats arrays. ------------------- 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