Erkki Seppala a écrit :
Richard Jones <[EMAIL PROTECTED]> 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.

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to