Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] syntax of private constructors in CVS version
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-07-01 (17:20)
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              \--------|
> > |--------\ /--------|
> 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 Archives:
Bug reports: FAQ:
Beginner's list: