John Wilson schrieb:
[...]
> It's virtually impossible to do effective type inferencing with Groovy
> semantics. E.G. with
> 
> int a = 1
> int b = 2
> def x = a + b

I can assume x is int. But I am not free in assuming that the plus 
method is really hat I assume and that x will get the right type. So I 
need alternate paths.

[...]
> I have never seen any way of doing unguarded direct method calls in
> Groovy. It is possible to generate synthetic helper methods on a
> compiled Groovy class which can be safely called directly but these
> helper methods need to do checks before they can pass the call on to
> the target method; so you are, in effect, doing guarded calls.

yes. I don't intend to change the semantics of Groovy in that area, so 
every call is guarded in some way. But how guarding is done is important 
too.

[...]
> Still, Jochen has been thinking about this for longer than I have - so
> maybe he's seen something I've missed.

I found out the guarding itself is not so bad. hotspot can remove many 
of those checks. The important part here is that the guards are in the 
call site or else it is very fast anything but monomorphic.

bye blackdrag

-- 
Jochen "blackdrag" Theodorou
The Groovy Project Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "JVM 
Languages" group.
To post to this group, send email to [email protected]
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