From: Charles Oliver Nutter Date: 2009-02-26T03:46:31+09:00 Subject: [ruby-core:22483] Re: YASNP (Yet Another Selector Namespace Proposal) Florian Gilcher wrote: > > On Feb 25, 2009, at 6:17 AM, 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 > > Is FUD the new "the opposition doesn't convince me"? I hear it a lot. I > think it's overused. Also, I find it insulting or at least a "verbal" > fauxpas as well as misplaced[1]. I think the FUD here is "oh no, what if this happens or that happens and code gets more complicated!". You can what if any feature to death, but without considering the probability of real issues it really is FUD. And of course the "what iffers" may not be weighing those scenarios against the positive uses of namespaces. > The problem is rather obvious: suddently, I can have multiple > definitions of a method (or none!) depending on context. Nowadays, i can > just inspect/test that behaviour in IRB/rdb and be sure that it is about > the same everywhere (safe for the unusual catch that it could be > un/redefined along the way). With selector namespaces, that catch would > get commonplace. I wanted to point out that having the following namespace: module Foo; def to_s; 'blah'; end; end using Foo 'hello'.to_s Is really no different from the following code, other than being cleaner and shorter: module Foo; def Foo.to_s(str); 'blah'; end; end Foo.to_s('hello') You can't really control what any library decides to do today, so I don't think you lose any more control with namespaces. And monkeypatching code because you want *others* to be affected has always been a losing proposition...since they may have monkeypatched code to affect *you* already. > BTW: how will IRB handle file-based switches? It would need to have modifications to its parser logic to support namespacing, just as it needed modifications to allow stabby lambdas through. - Charlie