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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-04-26 (22:38)
From: Andrew Lenharth <alenhart@c...>
Subject: Re: [Caml-list] help
On Mon, Apr 26, 2004 at 08:13:42PM +0100, Jon Harrop wrote:
> On Sunday 25 April 2004 1:45 pm, Henri DF wrote:
> > > I deliberately made "wnum" a reference so that it can be set:
> >
> > any reason not to make it a mutable ?
> No good reason. ;)

Take a look at how it is implemented in Pervasives.
>From the manual:

type 'a ref = {
   	mutable contents : 'a;

So, yea, unless you like another layer of indirection, just using
mutable should save you a little bit.


"It will work in practice, yes. But will it work in theory?"
--- a french diplomat's comment, recalled by Madeleine  Albright

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