From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 09961BC37 for ; Sun, 8 Nov 2009 21:09:53 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoDALiz9kpQRFuwWWdsb2JhbACbbQEWFQS9IYQ+BIFo X-IronPort-AV: E=Sophos;i="4.44,704,1249250400"; d="scan'208";a="49996001" Received: from furbychan.cocan.org ([80.68.91.176]) by mail4-smtp-sop.national.inria.fr with ESMTP; 08 Nov 2009 21:09:53 +0100 Received: from rich by furbychan.cocan.org with local (Exim 4.63) (envelope-from ) id 1N7E59-00087a-UE; Sun, 08 Nov 2009 20:09:51 +0000 Date: Sun, 8 Nov 2009 20:09:51 +0000 To: Daniel =?iso-8859-1?Q?B=FCnzli?= Cc: caml-list@inria.fr Subject: Re: [Caml-list] Unboxed float tuples Message-ID: <20091108200951.GA30792@annexia.org> References: <91a3da520911080801w6637b652w94a717a830b1c5bd@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <91a3da520911080801w6637b652w94a717a830b1c5bd@mail.gmail.com> User-Agent: Mutt/1.5.13 (2006-08-11) From: Richard Jones X-Spam: no; 0.00; unboxed:01 bunzli:01 unboxed:01 vectors:01 dependencies:01 syntax:01 camlp:01 lexemes:01 2009:98 imho:01 wrote:01 caml-list:01 tuples:01 tuples:01 data:02 On Mon, Nov 09, 2009 at 12:01:48AM +0800, Daniel Bünzli wrote: > Tuples and records are represented the same way. However when it comes > to records with only floats fields we get a special unboxed > representation. > > Why don't we get that for tuples of floats only ? > > Using tuples (vs records) to handles points and vectors is > syntactically more lightweight (IMHO). More important it makes it > easier to share that kind of data > between independent modules without introducing new dependencies. > However I don't want to sacrifice the unboxed representation for that. I guess others have pointed out why this isn't so easy. How about a syntax extension instead to turn a vector (| a, b, c |) into { v0 = a; v1 = b; v2 = c }, and a standard type to solve the module communication problem? I'm not sure if camlp4 will let you define bracket lexemes like that. Rich. -- Richard Jones Red Hat