From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA13750; Sun, 25 Aug 2002 11:55:16 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA14030 for ; Sun, 25 Aug 2002 11:55:15 +0200 (MET DST) Received: from relay.rinet.ru (relay.rinet.ru [195.54.192.35]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g7P9tDD12431 for ; Sun, 25 Aug 2002 11:55:13 +0200 (MET DST) Received: (from uucp@localhost) by relay.rinet.ru (8.11.6/8.11.6) with UUCP id g7P9tCT11292 for caml-list@inria.fr; Sun, 25 Aug 2002 13:55:12 +0400 (MSD) X-Envelope-To: caml-list@inria.fr Received: from dialin1.stormoff (ROVER1) [192.168.0.129] by stormoff with esmtp (Exim 3.12 #1 (Debian)) id 17itxK-000491-00; Sun, 25 Aug 2002 13:45:15 +0400 X-Comment-To: Maxence Guesdon To: caml-list@inria.fr Subject: Re: [Caml-list] packing Ocaml standard library into Std "namespace" References: <20020825005507.4ec07867.maxence.guesdon@inria.fr> From: Dmitry Bely Date: Sun, 25 Aug 2002 13:44:25 +0400 In-Reply-To: <20020825005507.4ec07867.maxence.guesdon@inria.fr> (Maxence Guesdon's message of "Sun, 25 Aug 2002 00:55:07 +0200") Message-ID: <3ct3s26e.fsf@mail.ru> User-Agent: Gnus/5.090005 (Oort Gnus v0.05) XEmacs/21.4 (Common Lisp (Windows [3]), i586-pc-win32) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Maxence Guesdon writes: >> Ocaml 3.05 and above introduces new packing facility (ocamlc "-pack" >> option). What do you think of using it to pack all Ocaml standard modules >> into one big Std module so that the user code could use them as >> Std.List.something, Std.Array.something etc. (having an analog of C++ >> std:: namespace)? > > Hum, Using Std.List.iter instead of just List.iter would be a pain > for me since I never 'open' standard modules. I could still open Std > at the beginning of each module but the best would then for the Std > module to be open by default (like Pervasives is). Well, altough I think Std should not be open by default (to not pollute user namespace), I realise that a lot of existing code will have to be modified then. Some time ago C++ community survived a similar change, but ... maybe to control this via a compiler option, say "-nostd" (like "-nopervasives")? > But there may be a problem (correct me if i'm wrong): > if I don't use, say Arg, in my program, the Arg module doesn't appear > in the executable. But if it is packed in std.cmo then Std.Arg will > be in my executable (as part of Std), as all the other standard > modules I don't use. Is that true ? Hmm, I did not tested that, but does not "ocamlc -pack -a" create the necessary library, where all submodules are independent? At least ocamlc/ocamlopt accepts such set of options :-) >> I think this will help us reduce the name clash dramatically. E.g. I have >> just discovered that I cannot modify ocamlild compiler to use Array.of_list >> somethere inside, because it already contains array.ml source file, that >> overlaps standard Array module. Having Std module, I just would write >> Std.Array.of_string there. > And can't you pack the new array module in another one, hiding the new > Array and letting the standard one visible ? No, because other ocamlild modules use that array.ml. So I have to modify many files to get access to the standard Array module... - Dmitry Bely ------------------- 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