<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2005/05/58267795e404d23e6686968eacd8d67e"
  from="Christophe Raffalli &lt;christophe.raffalli@u...&gt;"
  author="Christophe Raffalli"
  date="2005-05-10T18:19:14"
  subject="Re: [Caml-list] unboxing options"
  prev="2005/05/9cc85a652a6f23c0f7969e2143584503"
  next="2005/05/673536cfea964e1a6113b5a44033866d"
  prev-in-thread="2005/05/84b98879bcb504fb728dfba2b6103b66"
  next-in-thread="2005/05/044060475aa4fbf6c9f1d9f9e4e03e1a"
  prev-thread="2005/05/bc5084b4ee4838f0829f9e1f0d319f39"
  next-thread="2005/05/87479e8242941e44a1b561e930931482"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="unboxing options">
<msg 
  url="2005/05/84b98879bcb504fb728dfba2b6103b66"
  from="Charles Martin &lt;chaspost@y...&gt;"
  author="Charles Martin"
  date="2005-05-06T03:22:59"
  subject="unboxing options">
<msg 
  url="2005/05/58267795e404d23e6686968eacd8d67e"
  from="Christophe Raffalli &lt;christophe.raffalli@u...&gt;"
  author="Christophe Raffalli"
  date="2005-05-10T18:19:14"
  subject="Re: [Caml-list] unboxing options">
<msg 
  url="2005/05/044060475aa4fbf6c9f1d9f9e4e03e1a"
  from="Mike Hamburg &lt;hamburg@f...&gt;"
  author="Mike Hamburg"
  date="2005-05-11T17:19:41"
  subject="Re: [Caml-list] unboxing options">
<msg 
  url="2005/05/839576f084d909ebd28f2dd64dbf5018"
  from="Christophe Raffalli &lt;christophe.raffalli@u...&gt;"
  author="Christophe Raffalli"
  date="2005-05-11T18:50:24"
  subject="Re: [Caml-list] unboxing options">
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>

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

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
---------------------------------------------

</contents>

</message>

