hiding the 'mutable' modifier

From: Thomas Colcombet (Thomas.Colcombet@irisa.fr)
Date: Wed Feb 16 2000 - 15:05:32 MET

  • Next message: Jean-Francois Monin: "Re: Portability of applications written in OCAML"

    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



    This archive was generated by hypermail 2b29 : Fri Feb 18 2000 - 00:36:57 MET