From: Tobias Reif Date: 2002-02-26T04:24:02+09:00 Subject: Re: [ANN] TestUnit 0.1.1 Dave Thomas wrote: >I wrote: >>Dave, it would be nice if you could explain what I'm missing. > OK Thanks :) > DT> A minor incompatibility: the original toplevel 'rubyunit' aliased the > DT> global constant > DT> > DT> TestCase = RUNIT::TestCase > > TR> That looks strange to me. > > Perhaps, but its valid. No doubt :) I'm just trying to understand the concept. > That isn't the point. It _is_ in a module already. The 'rubyunit' > extension hides that fact by aliasing a class name. Why is it in a module? Probably for some other benefit, unrelated to namespaces(?) > (c) wrapping all the code, but making a hole in the wrapper in one place > to make it easier for folks using the code. Creating a module adds > one constant to the global namespace (the module name). Aliasing > something inside the module to something on the outside adds just > one more. Hm. I'm really trying to understand this (I'm still a RubyNewbie :). I'm currently designing a lib. @ first I had one file with some modules and many classes; usage code would just require this file, and use no "namespace prefixes" (what's the stuff called that looks like MODULE:: ?). Now that I'm planning on releasing the lib, I think that people might use it with other libs, so I'm planning on wrapping the whole thing in a module. Then people can either include the module and save the prefixes, or they can avoid collisions with other libs by not including the module and typing the prefixes. Would the above bullet c) apply here? (simple example(?)) What's the most POLS compatible approach in respect to most other libs, so users can just start, use it conveniently, and aren't surprised? Tobi -- * peace&love. * http://www.pinkjuice.com/