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
Why isn't -rectypes command line option the default
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-03-21 (02:13)
From: Erik de Castro Lopo <mle+ocaml@m...>
Subject: Re: [Caml-list] Re: Why isn't -rectypes command line option the default
Zheng Li wrote:

> So the main consideration is safety, though it's really fun to play with
> recursive types sometimes.

Ok, I can see why they aren't on by default, but using -rectypes on 
the whole file exposes to the whole file to these errors.

Wouldn't it be nicer to be able to specify the rectypes behaviour
per type? Maybe something like this would work:

	rec type 'a t = 'a * 'a t Lazy.t

  Erik de Castro Lopo
"Mutable state is actually another form of manual memory management: every 
time you over-write a value you are making a decision that the old value is 
now garbage, regardless of what other part of the program might have been 
using it." -- Paul Johnson