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
Unboxed float tuples
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-11-08 (20:09)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Unboxed float tuples
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.


Richard Jones
Red Hat