Bill Dortch wrote:
I like it.  A couple of things:

- I think in many/most cases we could determine the args/types, and type of callback method (simple/full) from the method signature.

We could determine how many required parameters, perhaps, but not optional parameter count (need to be passed as IRubyObject[]) or rest arg (probably an additional IRubyObject or RubyArray parameter).

I don't want to use signature to specify simple/full because there are cases even now where we could probably pass a block and still do fast invocation.

 - Should have a field for visibility.

Right, I forgot about visibility.

 - Would be nice to include aliases as well, e.g.,

    @JRubyMethod(name = "a", aliases = new String[] {"b", "c"} );

    Or maybe this would be a separate annotation, @JRubyAlias or similar...

I don't have a preference, but I do like the feel of aliases in the method annotation.

I especially like your idea of building in parameter coercion rules. I've been thinking about a similar "behind-the-scenes" coercion scheme for dealing with lightweight objects, should we choose to go there.

Yeah, it's just become painfully obvious that we have a lot of code duplication for coercion and method selection that could probably be generified and specified in an annotation.

It's worth mentioning that the alternative to annotations would be to have a bunch of flags to defineMethod to provide all this additional information, or to build up a separate data structure that's not an annotation and deal with attaching it to the methods. The annotation-driven approach sure seems a lot nicer.

- Charlie

---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to