From: Yehuda Katz Date: 2009-02-25T14:17:37+09:00 Subject: [ruby-core:22450] Re: YASNP (Yet Another Selector Namespace Proposal) --000e0cd327465665320463b75dfb Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 On Tue, Feb 24, 2009 at 9:13 PM, Jim Deville wrote: > > > > -----Original Message----- > > From: Jim Weirich [mailto:jim.weirich@gmail.com] > > Sent: Tuesday, February 24, 2009 8:53 PM > > To: ruby-core@ruby-lang.org > > Subject: [ruby-core:22448] Re: YASNP (Yet Another Selector Namespace > > Proposal) > > > > > > On Feb 24, 2009, at 11:29 PM, Jim Deville wrote: > > > > > As an example, what if I am using Merb, and two plugins, which all > > > define a namespaced method, which I want to change. That's three > > > namespaces that I have to __know about__ and modify. As opposed to > > > one now. > > > > I must admit, I'm a little confused by the above. Maybe we have > > different understandings about what selector namespaces are and what > > they do. > > > > If three plugins each define a method named "xyz" in different > > modules, you have three different methods in three modules. Adding > > namespaces doesn't change that. All the namespace does is allow > > programmers to say "Over this section of code, calling a method named > > 'xyz' will come from this module rather than that module." > > > > Could some elaborate about their fears of name spaces creating > > fences. I don't quite understand what they are getting at. > > > > Thanks. > > > > -- > > -- Jim Weirich > > -- jim.weirich@gmail.com > > > > > > Clarification of my example: If three namespaces define xyz, and you want > all of the xyz's to act differently, then you need to modify three > namespaces with monkeypatching. This way you change their effects wherever > you use them. > > Rebuttal of my example: As pointed out by Charlie here and offlist, the > proper way to handle this conflict of namespaces is to create your own > namespace that does what you want. > > Overall, the example wasn't my major point, my point was in asking the same > community that is lively about this discussion, and very creative (just see > the Ruby projects in existence), to come up with ways that this can be > misused. Throw them out there so we can see if there is a large downside. I > don't know if there is. This example wasn't meant to prove it wrong, just to > give an idea. > > I guess this kind of falls under bikeshedding, but I think that it is valid > to partake in some of this kind of brainstorming before this, or any, > proposal is accepted. > > JD > > -- Yehuda Katz Developer | Engine Yard (ph) 718.877.1325 --000e0cd327465665320463b75dfb Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I'm also in favor of discussing this, but all I hear so far in oppositi= on is vague FUD... no specific examples of problems that could be caused. I= t would be a lot easier to have a lively discussion about specific concerns= , and I'd love to have it!

-- Yehuda

On Tue, Feb 24, = 2009 at 9:13 PM, Jim Deville <jdeville@microsoft.com> wrote:


> -----Original Message-----
> From: Jim Weirich [mailto:jim= .weirich@gmail.com]
> Sent: Tuesday, February 24, 2009 8:53 PM
> To: ruby-core@ruby-lang.org=
> Subject: [ruby-core:22448] Re: YASNP (Yet = Another Selector Namespace
> Proposal)
>
>
> On Feb 24, 2009, at 11:29 = PM, Jim Deville wrote:
>
> > As an example, what if I am using Merb, and two plugins, which al= l
> > define a namespaced method, which I want to change. That's th= ree
> > namespaces that I have to __know about__ and modify. As opposed t= o
> > one now.
>
> I must admit, I'm a little confused by the above. =A0Maybe we have=
> different understandings about what selector namespaces are and what > they do.
>
> If three plugins each define a method named "xyz" in differe= nt
> modules, you have three different methods in three modules. =A0Adding<= br> > namespaces doesn't change that. =A0All the namespace does is allow=
> programmers to say "Over this section of code, calling a method n= amed
> 'xyz' will come from this module rather than that module."= ;
>
> Could some elaborate about their fears of name spaces creating
> fences. =A0I don't quite understand what they are getting at.
>
> Thanks.
>
> --
> -- Jim Weirich
> -- jim.weirich@gmail.com<= br> >
>

Clarification of my example: If three namespaces define xyz, an= d you want all of the xyz's to act differently, then you need to modify= three namespaces with monkeypatching. This way you change their effects wh= erever you use them.

Rebuttal of my example: As pointed out by Charlie here and offlist, the pro= per way to handle this conflict of namespaces is to create your own namespa= ce that does what you want.

Overall, the example wasn't my major point, my point was in asking the = same community that is lively about this discussion, and very creative (jus= t see the Ruby projects in existence), to come up with ways that this can b= e misused. Throw them out there so we can see if there is a large downside.= I don't know if there is. This example wasn't meant to prove it wr= ong, just to give an idea.

I guess this kind of falls under bikeshedding, but I think that it is valid= to partake in some of this kind of brainstorming before this, or any, prop= osal is accepted.

JD




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