Version française
Home     About     Download     Resources     Contact us    
Browse thread
Wanted: your feedback on the hierarchy of OCaml Batteries Included
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Michaël_Le_Barbier <Michael.Le-Barbier@l...>
Subject: Re: [Caml-list] Wanted: your feedback on the hierarchy of OCaml Batteries Included
Erkki Seppala a écrit :
> Richard Jones <rich@annexia.org> writes:
>
>   
>> On Tue, Nov 18, 2008 at 10:56:18AM +0100, David Teller wrote:
>>     
>>>  open System.IO;;
>>>  open System.File;;
>>>       
>> Your biggest problem is using dot ('.') instead of underscore ('_').
>>     
>
> However, this would take away some of the benefits. For example I
> prefer using the least amount of opening of modules, to make it easier
> to see where the values come from, and let module S = System would
> give me both IO and File reachable through S.IO and S.File
I subscribe to Richard Jones and Zheng's comments,

>> Using a dot means that the System namespace cannot be extended by
>> external packages.  If you use an underscore then an external package
>> can extend the namespace (eg. by providing System_Newpackage)
>>     
> I'm not sure how beneficial it would be that an external package can
> extend the hierarchy anyway.

Disllowing third parties to extend the namespace enforces organization 
of libraries in terms of PROVIDER, FUNCTIONNALITY. For the galaxy of 
small modules porviding multi-purpose functionnalities, hiding the 
provider from the name space makes programs and module lists more 
legible. For instance, in CPAN (Perl) providers does usually not appear 
in the namespace, and searching functionnalities in the wealth of 
modules in CPAN is made (more) easy by this.