Version française
Home     About     Download     Resources     Contact us    
Browse thread
hiding the 'mutable' modifier
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Thomas Colcombet <Thomas.Colcombet@i...>
Subject: hiding the 'mutable' modifier
hello,

I'd like to do something that looks like :

module A =
  (struct
     type t = { mutable field : int }
  end : sig
     type t = { field : int }
  end)

This is not allowed by ocaml, however
I think it would be useful  if the mutable
field is modified, let's say, only during the
construction of terms of type t, but must not
be modified outside the module (for consistency
reasons).
Is there any typing or implementation issue
which prevents such mutable modifier hiding ?

	Thom