groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Theodorou <>
Subject Re: Extension method upgrades
Date Thu, 21 Dec 2017 18:05:07 GMT
On 21.12.2017 05:02, Nathan Harvey wrote:
> That's true, "use" does offer control over the scope. Why is it more
> difficult to implement it in a dynamic context versus a static one?

"use" activates categories, but to activate them, you need to know them. 
In dynamic Groovy that is the runtime, in static Groovy it is the 
compiler. That means the static compiler can already only compile the 
use-constructs as lexical categories right now. The dynamic version uses 
a thread local scope to "see" categories during runtime. For the dynamic 
version to be like the lexical version you would have to know the 
calling context. And even though thread-local is such a context, it is 
too wide scoped for this. I am not saying we cannot implement that. I am 
saying that the current infrastructure we have in place does not provide 
us with that. That means there will be most likely bigger changes to the 
callsite caching and here the old callsite caching code is actually in 
the way. Again... all doable... but this will be a change to a dozens of 
files or so in a difficult area, just to provide the additional 
information on the callsite.

bye Jochen

View raw message