caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Christophe Raffalli <christophe.raffalli@univ-savoie.fr>
To: Charles Martin <chaspost@yahoo.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] unboxing options
Date: Tue, 10 May 2005 20:19:11 +0200	[thread overview]
Message-ID: <4280FB1F.3050003@univ-savoie.fr> (raw)
In-Reply-To: <20050506032256.10948.qmail@web90105.mail.scd.yahoo.com>

[-- Attachment #1: Type: text/plain, Size: 1338 bytes --]


>     type 'a foo = { one : 'a option; mutable two : 'a
> option }
>
> would become:
>
>     type 'a foo = { optional one : 'a; optional
> mutable two : 'a }
>

You could also unbox any data type whose size is know at compile time in
a record if an "unboxed" keyword is present ... and remove the nasty bit
of the compiler handling float in record.

{ unboxed float x; unboxed muatable float y }

You could imagine doing the same for array with a type ('a, 'b) array
where 'a is the type of the content and 'b is either `Boxed or `Unboxed
(using polymorphic variant)

but you still need a test for polymorphic function on array which need
to know if the array is unboxed and if yes what is the size of each
array cell.

I guess the code for this is not much more complex that the actual code
for float optimization, and is more general.



--
Christophe Raffalli
Université de Savoie
Batiment Le Chablais, bureau 21
73376 Le Bourget-du-Lac Cedex

tél: (33) 4 79 75 81 03
fax: (33) 4 79 75 87 42
mail: Christophe.Raffalli@univ-savoie.fr
www: http://www.lama.univ-savoie.fr/~RAFFALLI
---------------------------------------------
IMPORTANT: this mail is signed using PGP/MIME
At least Enigmail/Mozilla, mutt or evolution
can check this signature. The public key is
stored on www.keyserver.net
---------------------------------------------

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

  reply	other threads:[~2005-05-10 18:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-06  3:22 Charles Martin
2005-05-10 18:19 ` Christophe Raffalli [this message]
2005-05-11 17:18   ` [Caml-list] " Mike Hamburg
2005-05-11 18:50     ` Christophe Raffalli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4280FB1F.3050003@univ-savoie.fr \
    --to=christophe.raffalli@univ-savoie.fr \
    --cc=caml-list@inria.fr \
    --cc=chaspost@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).