Re: [Jruby-devel] ruby_case for Java camelCase methods

2006-03-31 Thread David Corbin
On Friday 31 March 2006 08:52 am, Thomas E Enebo wrote: >This is prone to the same problem that took us away > from lazy instantiation in the first place. Namely, if > you define a method in Kernel or Object matching the camel > case name that you are hoping will be lazily created, then > met

Re: [Jruby-devel] ruby_case for Java camelCase methods

2006-03-31 Thread Thomas E Enebo
This is prone to the same problem that took us away from lazy instantiation in the first place. Namely, if you define a method in Kernel or Object matching the camel case name that you are hoping will be lazily created, then method_missing will not be called. Perhaps, this is ok for came

Re: [Jruby-devel] ruby_case for Java camelCase methods

2006-03-31 Thread David Corbin
On Thursday 30 March 2006 10:21 pm, Charles O Nutter wrote: > That's a possibility. > > def method_missing(sym, *args) > camel = to_camel(sym) > super unless respond_to?(camel) return super unless respond_to? camel > send(camel, *args) > end > I'm sure that's what you meant :) > On

Re: [Jruby-devel] ruby_case for Java camelCase methods

2006-03-30 Thread Charles O Nutter
That's a possibility.def method_missing(sym, *args)  camel = to_camel(sym)  super unless respond_to?(camel)  send(camel, *args)endOn 3/30/06, Nick Sieger <[EMAIL PROTECTED]> wrote: On 3/30/06, Charles O Nutter <[EMAIL PROTECTED] > wrote: I personally think the ruby_case makes Java integrated code

Re: [Jruby-devel] ruby_case for Java camelCase methods

2006-03-30 Thread Nick Sieger
On 3/30/06, Charles O Nutter <[EMAIL PROTECTED]> wrote: I personally think the ruby_case makes Java integrated code look a lot nicer, but I am bothered by the namespace pollution and by having two of so many methods. A new thought (to me), don't know if this has been mentioned before -- could you

Re: [Jruby-devel] ruby_case for Java camelCase methods

2006-03-30 Thread Charles O Nutter
I'll take a stab too...Performance impact should be fairly small. The code to add the aliases is also written in Java, and only adds aliases for camelCased methods. This means extra AliasMethod objects are created and added to the methods hash, but object creation is pretty lightweight and HashMap

Re: [Jruby-devel] ruby_case for Java camelCase methods

2006-03-30 Thread Thomas E Enebo
The two raised questions with the feature so far are: 1. Performance 2. Method namespace pollution We have largely not decided things from a performance perspective. Since this landed, I cannot really tell if it is slower or not. I am guessing if I am having a hard time seeing it, it is no

Re: [Jruby-devel] ruby_case for Java camelCase methods

2006-03-30 Thread David Corbin
On Wednesday 29 March 2006 03:15 pm, Charles O Nutter wrote: > 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_ign

Re: [Jruby-devel] ruby_case for Java camelCase methods

2006-03-29 Thread Nick Sieger
On 3/29/06, Charles O Nutter <[EMAIL PROTECTED]> wrote: I just committed a change to create additional ruby_case aliases for all camelCase Java methods in included classes.It feels right when your head is coding in ruby mode, but I don't know that it adds all that much, and actually obscures the po