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] ocaml killer
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-02-02 (11:08)
From: Florian Hars <hars@b...>
Subject: Re: fancy types (was Re: [Caml-list] ocaml killer)
Vasile Rotaru wrote:
> The difference between the two versions are in those two calls
>     (id specialist/..)               ; obviously a nop
> and
>     (makeblock 0 specialist/..)      ; ???
> Comments about whether (makeblock 0 ..) is a special case which can be
> optimized away are welcome.


let do_rec (S specialist as spec) n =
   if n = 0 then
     n * specialist spec n

instead, and the code becomes a simple spec/..

Isn't it a standard idiom to pass the same cons cell on recursive calls instead 
of rebuilding an otherwise identical copy?

Yours, Florian Hars.

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