From: Michal Suchanek Date: 2009-02-27T22:05:45+09:00 Subject: [ruby-core:22570] Re: YASNP (Yet Another Selector Namespace Proposal) 2009/2/26 brian ford : > On Wed, Feb 25, 2009 at 9:23 AM, Brian Ford wrote: >> On Feb 24, 9:17��pm, Yehuda Katz wrote: >>> I'm also in favor of discussing this, but all I hear so far in opposition is >>> vague FUD... no specific examples of problems that could be caused. It would >>> be a lot easier to have a lively discussion about specific concerns, and I'd >>> love to have it! >>> -- Yehuda >>> > > Your proposal, correct me if I am wrong, is point-of-use not > point-of-definition. In other words, I need to specifically declare > that I am in a namespace so that my method calls will find your > version of the method. > > I installed Merb the other day. All *42* gems of it. Let's use that as > a hypothetical example. > > Assume that you have a few custom methods spread across Array, Hash, > String, Symbol and maybe Date or Regexp. That is pretty reasonable, > isn't it? You want to use your methods so you need the namespace > declaration in your file(s). But which files? Only the files in which > you use your methods? Then what happens when someone later is doing > some maintenance and forgets to add the using declaration. All the > files? That is a lot of ceremony. > > I cannot even comprehend yet what nested selector namespaces would > actually mean/do/look like, but there has to be some way in the > example above to say that your namespace for String, Array, etc are > all active at the same time. The proposed block-ish-not-really syntax > doesn't scale(tm). It would have to be something like this syntax: > > using Merb::String > using Merb::Array > using Merb::Hash I assumed you could just type using Merb and you would get all the extensions in the Merb module. The need to specify each class separately adds more complexity and maintenance. It might be useful occasionally but most of the time you want all the extensions you wrote for use in your framework. I would guess it would be even impossible to include one without the other most of the tie as the added methods would depend on each other. Thanks Michal