2009/4/5 Thomas E Enebo <[email protected]>: > I would expect a type-error (compile-error?). There are only three > arguments and this specifies four. I think signatures need to map > straight through between Ruby and Java names. How to bind to > restargs should probably default to <type>[] (e.g. String[]), but > perhaps there should be a way of assigning via collection types too > (perhaps as an option?).
About mapping straight through, I answer with the one-to-one mapping below. > Introspecting Ruby method could give us knowledge of whether we need > restargs or not. Yes, of course, but if we let to asign more variables and map them into the restargs, an option to generate a signature with varargs should be added. > If you wanted to have a four argument string which fed into that > signature you need only add: > > [java.lang.String,java.lang.String,java.lang.String,java.lang.String] > => Java::void > def foo4(a,b,c,d) > foo(a,c,c,d) > end > > In general, I think having one-to-one mapping between variable names > will be less surprising to people. It is easy to compose on Ruby side > (like in my example above) to have signatures which are not > one-to-one. I don't think a one-to-one mapping would be enough. For the example above, two methods would be generated, instead of one method overloaded. I rather have an overloaded method than two different methods with different names for the same functionality. Anyway, this lead us to being able to specify the java method name, something useful for getting getters. Both solutions seem fine to me, even if I prefer the first one, yours would add more naturaly the setting the java method name. Cheers, Serabe -- http://www.serabe.com --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
