Robert Klemme wrote:
> On 12.04.2008 20:40, Chris Shea wrote:
>>>  end
>> 
>> Can you show a use case where using modules as namespaces isn't enough?
Yeah the only thing I can think of it being useful for would be when you 
are 'meta-running' code

I got the idea as python doctests can run each file's doctest in a 
'separate namespace' so that they don't munge each others tests.
I suppose you can accomplish about the same thing by [as rails 
active_support does] keeping track of which new constants are created 
during a test and tearing them down.
Another use would be if you were running multiple rails instances with 
the same ruby--you might want them each to live in distinct lands.

> classes that would not have anything in common.  In this particular case
> the behavior could be emulated with inheritance:
Interesting point.  I agree with you that it would add some serious 
complexity, though, which might be a bad thing.

Take care.
-R
-- 
Posted via http://www.ruby-forum.com/.