Browse thread
[Caml-list] syntax of private constructors in CVS version
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | brogoff@s... |
| Subject: | Re: [Caml-list] syntax of private constructors in CVS version |
On Tue, 1 Jul 2003, Pierre Weis wrote: > > Would it be fair to say that the main distinction between private types > > and abstract types is that with private types, constructors are only > > invocable from inside the module, but destructors (e.g., pattern > > matching) are available both inside and outside of the module? > > > > y > > -- > > |--------/ Yaron M. Minsky \--------| > > |--------\ http://www.cs.cornell.edu/home/yminsky/ /--------| > > You are right: that's yet another way to say it :) To make this a bit more consistent, wouldn't it be better to restrict the occurrence of private to signatures? It is currently allowed in structs too. Is there a case where it is useful outside of a signature? There was a similar idea that was proposed a while ago about providing an immutable view of mutable objects, which is also appealing. Any progress with that one? -- Brian ------------------- 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