From: Yehuda Katz Date: 2009-02-28T01:24:45+09:00 Subject: [ruby-core:22574] Re: YASNP (Yet Another Selector Namespace Proposal) --000e0cd181c06f6a940463e8e6dd Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit In the OP, you could do: using Merb::* -- Yehuda 2009/2/27 Michal Suchanek > 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 > > -- Yehuda Katz Developer | Engine Yard (ph) 718.877.1325 --000e0cd181c06f6a940463e8e6dd Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable In the OP, you could do:

using Merb::*

-- Yehuda

2009/2/27 Michal Suchanek <hramrach@centrum.cz>
2009/2/26 brian ford <brixen@gmail.c= om>:
> On Wed, Feb 25, 2009 at 9:23 AM,= Brian Ford <brixen@gmail.com>= ; wrote:
>> On Feb 24, 9:17=A0pm, Yehuda Katz <wyc...@gmail.com> wrote:
>>> I'm also in favor of discussing this, but all I hear so fa= r in opposition is
>>> vague FUD... no specific examples of problems that could be ca= used. It would
>>> be a lot easier to have a lively discussion about specific con= cerns, 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 tha= t 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<= br> > 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<= br> > 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 maintena= nce.

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




--
Yehuda Katz
D= eveloper | Engine Yard
(ph) 718.877.1325
--000e0cd181c06f6a940463e8e6dd--