Charles Oliver Nutter wrote:
Charles Oliver Nutter wrote:
This extensive support of Ruby naming may be going too far. I'm
really looking for opinions on this, to see whether it's too much. In
general my primary goal was to allow users to use either straight-up
Java names or various gradations of Ruby names, all the way to the
most Ruby-like = or ? underscored names. So those extreme cases work
and all intermediate cases work. But is it excessive?
There is another small issue here: extending concrete classes. Because
in the extension/override case there's usually already existing
methods of that name, the Ruby naming logic I added for interfaces
doesn't work.
The way I justify it for the moment is that overriding methods from a
concrete or abstract superclass is about replacing exactly the
same-named method. But of course there's an argument to be made that
you should be able to replace that method with any of its Ruby
analogs. So, what do you think? If I have this code in Java:
public class Foo {
public Object getBar() { ... }
public void setBar(Object bar) { ... }
}
Should I be able to do this:
class RubyFoo < Foo
def bar; my_getBar_logic; end
def bar=(x); my_setBar_logic; end
end
The only thing I'm concerned with is consistency between interfaces and
concrete classes. If we're not doing it for classes, then we shouldn't
do it for interfaces either.
Cheers
--
Ola Bini (http://ola-bini.blogspot.com)
JRuby Core Developer
Developer, ThoughtWorks Studios (http://studios.thoughtworks.com)
Practical JRuby on Rails (http://apress.com/book/view/9781590598818)
"Yields falsehood when quined" yields falsehood when quined.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email