<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/07/32a40dd0400e6e67ba0420eff5aa16c3"
  from="Pierre Weis &lt;pierre.weis@i...&gt;"
  author="Pierre Weis"
  date="2003-07-15T08:22:34"
  subject="Re: [Caml-list] syntax of private constructors in CVS version"
  prev="2003/07/e1d3789e4095909694f1b11298762891"
  next="2003/07/a7dc933f5630b69d8aaaade2b2a1795a"
  prev-in-thread="2003/07/e1d3789e4095909694f1b11298762891"
  next-in-thread="2003/06/a0187e5d430351691489ab943636ce50"
  prev-thread="2003/06/a03edde7de13ace25d84ede87d813c3f"
  next-thread="2003/06/5a327328e9738765806d584d52354b45"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] syntax of private constructors in CVS version">
<msg 
  url="2003/06/59218369fd3fa7dddfd9df9c7869c6bc"
  from="Shaddin Doghmi &lt;shaddin@m...&gt;"
  author="Shaddin Doghmi"
  date="2003-06-27T20:50:41"
  subject="[Caml-list] syntax of private constructors in CVS version">
<msg 
  url="2003/06/b25986b3483edf8a66caeff6d4dfa914"
  from="brogoff@s..."
  author="brogoff@s..."
  date="2003-06-27T21:29:12"
  subject="Re: [Caml-list] syntax of private constructors in CVS version">
<msg 
  url="2003/06/6bf322f4a3555c3fcf5db70b3fe39eba"
  from="Shaddin Doghmi &lt;shaddin@m...&gt;"
  author="Shaddin Doghmi"
  date="2003-06-27T23:49:09"
  subject="Re: [Caml-list] syntax of private constructors in CVS version">
<msg 
  url="2003/06/a59fcd293310f2643da245c0f5ae1f05"
  from="brogoff@s..."
  author="brogoff@s..."
  date="2003-06-28T02:24:57"
  subject="Re: [Caml-list] syntax of private constructors in CVS version">
<msg 
  url="2003/06/655ccd72cd43d8d9384c5f32806301cd"
  from="Pierre Weis &lt;pierre.weis@i...&gt;"
  author="Pierre Weis"
  date="2003-06-30T18:39:07"
  subject="Re: [Caml-list] syntax of private constructors in CVS version">
<msg 
  url="2003/07/a6c7433918c84295b55fdd0b2150eca7"
  from="Hendrik Tews &lt;tews@t...&gt;"
  author="Hendrik Tews"
  date="2003-07-01T07:43:30"
  subject="Re: [Caml-list] syntax of private constructors in CVS version">
</msg>
<msg 
  url="2003/07/dc704013788c4589829696f7dfb16ae4"
  from="Yaron M. Minsky &lt;yminsky@c...&gt;"
  author="Yaron M. Minsky"
  date="2003-07-01T10:37:10"
  subject="Re: [Caml-list] syntax of private constructors in CVS version">
</msg>
<msg 
  url="2003/07/7f9e7fcd6f9f523709199fb503e1b759"
  from="Yaron M. Minsky &lt;yminsky@c...&gt;"
  author="Yaron M. Minsky"
  date="2003-07-01T10:51:32"
  subject="Re: [Caml-list] syntax of private constructors in CVS version">
<msg 
  url="2003/07/d22a306d1dca8af537a49f31e0884038"
  from="Pierre Weis &lt;pierre.weis@i...&gt;"
  author="Pierre Weis"
  date="2003-07-01T17:05:49"
  subject="Re: [Caml-list] syntax of private constructors in CVS version">
<msg 
  url="2003/07/7ea9688cc25a7ef880125869a2170e96"
  from="brogoff@s..."
  author="brogoff@s..."
  date="2003-07-01T17:20:44"
  subject="Re: [Caml-list] syntax of private constructors in CVS version">
</msg>
</msg>
</msg>
<msg 
  url="2003/07/66caba7829a123e6bb39d1d9c4b9bb00"
  from="John Max Skaller &lt;skaller@o...&gt;"
  author="John Max Skaller"
  date="2003-07-03T11:46:27"
  subject="Re: [Caml-list] syntax of private constructors in CVS version">
<msg 
  url="2003/07/1eccca803cd78c2ed7f87d84c07cacd3"
  from="Pierre Weis &lt;pierre.weis@i...&gt;"
  author="Pierre Weis"
  date="2003-07-07T22:31:28"
  subject="Re: [Caml-list] syntax of private constructors in CVS version">
<msg 
  url="2003/07/91fc472a8ed631257e1e6ea2685aaa2f"
  from="John Max Skaller &lt;skaller@o...&gt;"
  author="John Max Skaller"
  date="2003-07-13T09:11:47"
  subject="Re: [Caml-list] syntax of private constructors in CVS version">
<msg 
  url="2003/07/e1d3789e4095909694f1b11298762891"
  from="Laurent Vibert &lt;lvibert@i...&gt;"
  author="Laurent Vibert"
  date="2003-07-15T08:02:52"
  subject="Re: [Caml-list] syntax of private constructors in CVS version">
<msg 
  url="2003/07/32a40dd0400e6e67ba0420eff5aa16c3"
  from="Pierre Weis &lt;pierre.weis@i...&gt;"
  author="Pierre Weis"
  date="2003-07-15T08:22:34"
  subject="Re: [Caml-list] syntax of private constructors in CVS version">
</msg>
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2003/06/a0187e5d430351691489ab943636ce50"
  from="Chris Hecker &lt;checker@d...&gt;"
  author="Chris Hecker"
  date="2003-06-30T19:02:27"
  subject="Re: [Caml-list] syntax of private constructors in CVS version">
<msg 
  url="2003/07/1fed8977474ed12631a858ab780ab9fc"
  from="Pierre Weis &lt;pierre.weis@i...&gt;"
  author="Pierre Weis"
  date="2003-07-01T10:47:36"
  subject="Re: [Caml-list] syntax of private constructors in CVS version">
</msg>
<msg 
  url="2003/06/811ca16749dd2b66fc09665a2a8f413b"
  from="brogoff@s..."
  author="brogoff@s..."
  date="2003-06-30T21:36:57"
  subject="Re: [Caml-list] syntax of private constructors in CVS version">
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
&gt; On Sun, 13 Jul 2003, John Max Skaller wrote:
&gt; 
&gt; &gt; Pierre Weis wrote:
&gt; &gt; 
&gt; &gt; 
&gt; &gt; &gt; Records with mutable fields are permitted. Mutators explicitely exported
&gt; &gt; &gt; as functions are allowed, other mutations are forbidden.
&gt; &gt; 
&gt; 
&gt; So just a question : since mutations are forbidden, would it be safe to 
&gt; relaxe the variance for mutable field, to allow something like
&gt; 
&gt; type +'a foo = private {mutable it : 'a}

No, since the field ``it'' is indeed mutable and can be mutated either
directly from within the module implementation, or indirectly via a
mutator function that would be exported in the interface.

In addition, the compiler has to know that field ``it'' is mutable, so
that it can take care of ``it'' fields in pattern matching (the
compiler must bind the contents of those field patterns to avoid bus
errors in the expression part of the corresponding clause).

Euh, if you really want a field to be treated as not mutable, just
define it as immutable :)

Simple enough, isnt'it ?

Best regards,

Pierre Weis

INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/


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

</contents>

</message>

