From: kentda@... Date: 2001-09-23T11:42:26+09:00 Subject: [ruby-talk:21571] Re: What's the "Data" class? Don't we need a namespace for standard classes? On 21 Sep 2001, Ryo Furue wrote: > This makes me think that Ruby really needs to hide its "standard > library" (File, Time, Socket, etc. Is "Data" part of it?) into a > single namespace and to keep the default namespace as clean as > possible. Currently it's too much "polluted" (no derogatory meaning > intended). C++ did this in its international standard: it hides all > its standard library in the namespace "std". If you don't know C++, I > illustrate the idea in pseudo-Ruby code: I would hate to have to prepend every usage of the library classes with Std or something like that. Doing a require "Std" would degenerate into the loathed "using namespace std;" on global level in C++. My personal views are: - 1) The commonly used parts of the standard library should not move into a namespace. Some parts might benefit from being in specific namespaces. But putting Array, Hash etc in such a namespace will only increase tedium. - 2) Every class, module etc that the standard library provides in the global namespace should be documented. Your problem should not have extended beyond looking up the standard library reference and finding a "Data" entry. Rather than seeing a documenting nightmare, I too wish for a lean global namespace. - 3) Application and extension writers should use namespaces. That goes for medium sized scripts also. The main entrypoint is all that ought to rear its head in the global namespace. Just my 0.02 NOK -- <[ Kent Dahl ]>================<[ http://www.stud.ntnu.no/~kentda/ ]> )____(stud.techn.;ind.�k.data)||(softwareDeveloper.at(Trustix))_( /"Opinions expressed are mine and not those of my Employer, "\ ( "the University, my girlfriend, stray cats, banana fruitflies, " ) \"nor the frontal lobe of my left cerebral hemisphere. "/