[Nitro] [Fwd: About the Menubar collision (follow-up)]

Jonathan Buch john at oxyliquit.de
Fri Jul 6 02:06:22 EDT 2007


Hi,

> I'm taking this on-list, I suppose nobody really minds.

Nope, on list is fine.  Jimmy:  zip files are ok here (until you hit a
limit, in which case the mailing list will send you a mail back that
you hit that limit), and the list is so low volume, that it really
doesn't hurt.  :)

> So this indeed returns the top-level class. The constant method is from  
> facets. It looks to me it doesn't work like one would suspect...

Hi, yes, the constant method looks up the given path from the current
position (unless you prefix it with ::), that's what the code and the
comment tells me.  The test-cases on the other hand displays more.

class TCKernel < Test::Unit::TestCase

     def test_constant
       c = "Test::Unit::TestCase"
       assert_equal( ::Test::Unit::TestCase, constant(c) )

It seems, like with just writing without the :: it'll look it up too,
meaning you can't control that it looks up the `Object` as well.
Well, on the other hand, normal ruby lookup works like that too, first
look in current, then go all the way back to Object.

So, better be careful where you put and name your classes.  :P

Jo

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


More information about the Nitro-general mailing list