From: Chris Carter Date: 2007-07-15T00:39:12+09:00 Subject: Re: Proposal: runtime-modifying Kernel methods should be keywords On 7/13/07, Marcel Molina Jr. wrote: > On Fri, Jul 13, 2007 at 03:02:06PM +0900, Charles Oliver Nutter wrote: > > 2. Because many of these methods manipulate normally-inaccessible > > runtime state, it is not possible to implement them in Ruby code. > > Therefore, even if someone wanted to override them (the primary reason > > for them to be methods) they could not duplicate their behavior in the > > overridden version. Overriding only destroys their utility. > > I certainly have little influence in this matter, and your appeal is really > targeted at only a handful of people (Matz, Evan, John, etc) but though I > acknowledge that having that functionality implemented as methods makes > little sense especially since all the state it operates on is hidden away in > the internals, *my* interests and priorities would respond to that problem by > wanting to consider how those internals my instead be *exposed*. In some > cases that might not really be straight forward or make sense, and it flies > in the face of all your desired optimizations but I just wanted to provide a > perspective from someone with different priorities than yours. > > In almost all cases I would want Ruby to be more open at the cost of > performance. > > Though I'm not against what you are proposing. Given the current state of > affairs, it makes sense to make all those things keywords. I'd just rather, > idealistically, move in the other direction. > > marcel > -- > Marcel Molina Jr. > > I agree here. Also, I would like to note that Ruby seems to be moving away from keywords with return values (loss of yield), which I think is a great move, and this pushes us back in the opposite direction. We also lose the ability to cleanly create our own methods named eval() on an object. Say you have a MathematicalExpression class with a method eval. How would this work, if the compiler were to see all eval() calls as calls to Kernal#eval? I am sure you remember the big discussions around #send that always pop up, people always want to override methods. -- Chris Carter concentrationstudios.com brynmawrcs.com