From: Austin Ziegler Date: 2006-06-04T05:26:46+09:00 Subject: Re: Another Look at SELECTOR NAMESPACES On 6/3/06, transfire@gmail.com wrote: > Austin Ziegler wrote: >> Fortunately, the choice isn't yours. > Wwhy do you have to go and do that? Does making a little digg like > that support your argument? It's not a dig. It's a statement of fact: the choice *isn't* yours. It isn't mine, either. However, you presented this as an either-or proposition, which this most certainly is not. I have serious doubts about the utility of selector namespaces (just as I have serious doubts about the utility of namespace "renaming" as some people seem to be asking for recently because of bad naming decisions by yet other developers). I think that the whole desire for a feature like "require_wrap" is foolish. That said, I see some value, given Ruby's open classes, in having the ability to have multiple methods named the same thing but with a distinguishing namespace. I think that there's too many unanswered questions to wholeheartedly support them, but they may prove useful. (For example, when is one defining a method in a namespace vs. overriding a method?) What I am absolutely certain about is that dynamic resolution of selector namespaces is a disaster waiting to happen. I would almost rather see Ruby adopt static typing than see dynamic resolution of selector namespaces and/or the modification of literal resolution based on such dynamic resolution. Because when you do *that*, you can no longer trust even the most basic syntactical rules of Ruby and what you have is less Ruby than Ruby with static typing would be. I *will* admit that I view most of the suggestions that you, personally, make with a great deal more suspicion because I think that you ask for things that are ten times more "clever" than they would ever be useful. Most of the things that you've proposed that I have opposed fall into the category of YAGNI, too. (I also take issue with some of your syntactical direction, which I think reduces readability and understandability of code.) > I just don't see your point when what you say is *unnecessry arcana* > can already be done --indeed is already being done. There just happens > to be odd exceptions, due to the lack of a more managed approach. For > example, not unlike the one I already gave. > > --- foolib.rb --- > > class X > class String > def self.new ; 0 ; end > end > end > > --- bar.rb --- > > require 'foolib' > > class X > def mystring > String.new( "Extended!" ) > end > end > > x = X.new > x.mystring #=> 0 (1) That's not selector namespaces as I understand it. (2) The fact that "String.new" is being used is an indication that something is different. (3) There's no way that the alteration of basic syntactical rules could *possibly* be easier to understand. Far better to work *with* other people than around them, if at all possible. -austin -- Austin Ziegler * halostatue@gmail.com * Alternate: austin@halostatue.ca