I just committed a change to create additional ruby_case aliases for all camelCase Java methods in included classes. For example, an included java.lang.String (as JString) has methods like:

sub_sequence
compare_to
equals_ignore_case

We may or may not want to provide a flag to turn this off, since it does add quite a few aliases. I think it looks pretty cool though, and I'd like to have it on by default. How nice is:

# assuming JFrame, JButton have been included already
f = JFrame.new("Frame")
b = JButton.new("Button")

f.set_size(200, 200)
f.content_pane.add(b)

f.show

We do not have the reverse case, where defining a method with underscores implements a Java method of the same name, so the following does not work:

class MyListener < ActionListener
  def action_performed(event)
  ...
  end
end

But I think it's a good start. At some level, I almost think everything should be ruby_case all the time, but I know that would cause some confusion when searching for specific methods.

Thoughts?

--
Charles Oliver Nutter @ headius.blogspot.com
JRuby Developer @ jruby.sourceforge.net
Application Architect @ www.ventera.com

Reply via email to