dweiss commented on issue #12655:
URL: https://github.com/apache/lucene/issues/12655#issuecomment-1759671663

   > By using a each closure the jdkVersion is private to the closure and the 
build-time evaluation has its own jdkVersion variable (which is a constant).
   
   Ah, thanks for clarifying, Uwe. I only looked at the diff and suspected the 
gstring to blame - overall it's the same thing - the previous code referenced a 
local variable (not the current loop's value, the variable). Switching to 
'each' makes the variable a closure argument, so it's indeed constant... it is 
sometimes tricky because if you nest another loop/closure, it can still observe 
the outer variable's current value. It's a virtue and a pain, depends on when 
you use it... 
   
   For what it's worth, I've tried switching a few builds to Kotlin... but I 
wasn't convinced. It's nice to have a type checker but there were many things 
that required more verbose constructs to achieve.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to