Jochen Theodorou wrote:
> ok, now I see the test... but that is no test with the receiver being null

Notice my output shows the bootstrapped method getting null for the 
receiver argument, and also look at line 61:

         return fake(null).target(b);

This gets rewritten by AnonymousClassLoader to be a cast to Dynamic...a 
dynamic call to target; but the receiver itself is most definitely null. 
This would never work through the normal invoke* operations.

Unless you're referring to the fact that the target method eventually 
bound to the call site is a static method? This is for simplicity in the 
example, to show that the invocation against null does bootstrap and 
does link just fine. Obviously there's no way to invoke an instance 
method through invokedynamic if there's no instance, but if you want an 
invocation against null to go directly to a specific object's instance 
method the adaptations should support that; perhaps a "replaceArgument" 
that substitutes your singleton NullObject in place of the null 
receiver? That's how I'd handle it.

> I am only saying that specifying by something that is very likely to 
> change very much is not useful. Helping to develop it is something else.

Specification and development are supposed to go hand-in-hand, or you 
end up with a bad specification and a bad implementation. I expect 
things I try now with invokedynamic to break later, and new things to 
come available. But I very much want invokedynamic to work for JRuby, so 
I'm making it it a high priority to try out every code drop John makes.

> I expect that to be a little more difficult in Groovy, because we are 
> more in touch with the bytecode.

More in touch with the bytecode? I assume you didn't mean that as an 
insult :)

- Charlie

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "JVM 
Languages" group.
To post to this group, send email to jvm-languages@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jvm-languages?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to