Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] const equivalent for mutable types?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jean-Marie Gaillourdert <jmg@g...>
Subject: Re: [Caml-list] const equivalent for mutable types?
Hi,
> Am Samstag, 31. Juli 2004 10:56 schrieb Christopher A. Gorski:
> > The problem is that in complex programs I often get confused over what
> > functions are modifying values and what functions are not.  I feel like
> > I should be able to do something like
> >
> > let result = change (const r)
> >
> > and have the compiler give me a type error.

let  const = (!)

will do the trick.

Regards,
  Jean-Marie Gaillourdet

-------------------
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