English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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 caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners