Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] unboxing of unary datatypes
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-01-14 (14:12)
From: Nicolas Cannasse <warplayer@f...>
Subject: Re: [Caml-list] unboxing of unary datatypes
> No, I think he sees something different here: The compiler does in fact
> optimize out the constructor and then operates directly on the value
(which, in
> this case, is a boxed float). But it does not perform the special float
> optimizations it does on values of the types float, float array and
> records like { x: float; y: float; ... (* All fields are floats *)} (but
not on
> tupels and sum types containing floats).

Yes, of course.
What I wanted to say here is that such representation compiler optimisations
have to be documented and somehow normalized in order to be able to
interface OCaml with C. As for floats array, there is a description of how
they are handled in the Manual chapter 17.3.3.
As the case of only-one-constructor is not documented, then there is no
optimisation :)

Nicolas Cannasse

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: