Here's a possible impl (attached). A sample usage: require 'java'
import java.lang.StringBuffer class StringBuffer java_alias :append_int, :append, [Java::int] end sb = StringBuffer.new sb.append_int(12345) # calls int version puts sb # => "12345" sb.append_int(123123123123123123) # error, too big for int On Sun, Oct 4, 2009 at 6:32 PM, Charles Oliver Nutter <[email protected]> wrote: > I just had an idea! I think we should also add java_alias to go with > java_send and java_method. java_alias would have the following form: > > java_alias :foo_with_byte, :foo, [Java::byte] > > The purpose is to allow you to add another method name that > specifically dispatches to a single signature. This would allow you to > avoid *all* overhead from method selection, java_send/java_method, and > so on. It would also allow you to expose method overloads with more > descriptive names. > > Does this sound like it would be a useful feature? > > - Charlie >
java_alias.patch
Description: Binary data
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
