Browse thread
Unboxed float tuples
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ 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. Rich. -- Richard Jones Red Hat