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] Why are arithmetic functions not polymorph?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-06-09 (09:44)
From: Jun.Furuse@i...
Subject: Re: easy print and read (was: [Caml-list] Why are arithmetic functions not polymorph?)

At Sun, 08 Jun 2003 01:49:21 -0700,
Chris Hecker wrote:
> >All this hard work needed a long time to mature (1995 -> 2003!) and is
> >now in a stable and satisfying state.
> This is great.  My concern about generics in ocaml is one of efficiency.  I 
> read the paper (as much as I could understand), and the flow array stuff 
> seems smart and better than type pattern matching in the case where you 
> don't know the definition of the generic function at the call point, but is 
> there going to be inlining with generics as well in this initial 
> implementation? 

This is one of the TODO items of G'Caml. 
You can hope that inlining of very simple generic values such as plus
will be available in near future, (but not in the next release, sorry.)
The inlining will occur only when:

  * The type of a generic value instance is statically known.
  * The corresponding overloaded definition is an identifier, such as
	(+) and (+.)

Inlining more complex generic values such as double 
(let double x = plus x x) will be another story...


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