On Wednesday 15 March 2006 09:02 pm, Charles O Nutter wrote: > including a module at the root level actually ends up including it into > Object, because all code runs within the context of a global Object > instance.
Are you describing jruby , or ruby (or both). It makes no sense to me why including something in one instance would be like including it the class that instance was created from. > Calling include at root is actually like calling the private > "include" method on the Object class, adding that module's capabilities to > all Object instances. My book (pickaxe2) doesn't list "include" as a method for Object. > Until there's a fix, you can work around it in a couple ways: > > 1. Don't define an add that gets included into the root object > 2. Call add before including that add definition (which will cause it to be > loaded for ArrayList and cached) > 3. Don't use add to add to the ArrayList I'm concerned that this behavior is going to impact a measurable chunk of our code. It certainly reveals a 'danger' in programming at the 'root' level that I've never heard about before (independent of the current bug). David ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ Jruby-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jruby-devel
