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 EAA28198; Sat, 28 Sep 2002 04:34:47 +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 EAA28175 for ; Sat, 28 Sep 2002 04:34:46 +0200 (MET DST) Received: from relay.pair.com (relay1.pair.com [209.68.1.20]) by nez-perce.inria.fr (8.11.1/8.11.1) with SMTP id g8S2YjD05009 for ; Sat, 28 Sep 2002 04:34:46 +0200 (MET DST) Received: (qmail 46310 invoked from network); 28 Sep 2002 02:34:43 -0000 Received: from node-d8e9cca2-sfo-onnet.worldcom.com (HELO checkerlap.d6.com) (216.233.204.162) by relay1.pair.com with SMTP; 28 Sep 2002 02:34:43 -0000 X-pair-Authenticated: 216.233.204.162 Message-Id: <4.3.2.7.2.20020927192452.02e6b520@mail.d6.com> X-Sender: checker@mail.d6.com X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Fri, 27 Sep 2002 19:34:45 -0700 To: caml-list@inria.fr From: Chris Hecker Subject: [Caml-list] float tuples as double_arrays? Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk The floats in an all-float tuple are boxed, unlike floats in all-float records. The latter are treated as float arrays internally and have double_array_tag. I'm wondering why the former aren't treated the same way? Complexity in the compiler and not wanting the double_array special case code to metastasize more is a perfectly valid answer. The only reason I ask is that the unboxed rep is more efficient, and tuples are more convenient for some things, like breaking things out with patterns: let x,y,z = v in (* use x y z here *) while with an array you'd have let [|x;y;z;|] = v in (* this generates an incomplete match warning because the size isn't typed *) or with a record let {x=x;y=y;z=z;} = v in (* need the module name on the field above if not opened, etc. *) Chris ------------------- 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