Gianluca, > On 10. 12. 2024, at 9:20, Gianluca Sartori <g.sart...@gmail.com> wrote: > ... The use of "var", as of today, falls "only" into the "beauty" category > because there is no real need for it.
I might be wrong and I might have misunderstood something of importance, but it seems to me there is one (and only one) very specific need to use var: ensuring a code copy/pasted from Java works (with as little number of problems as reasonably possible). When one makes such code groovy e.g., by removing semicolons, one would also replace all vars by defs, of course, and vars are not needed anymore; but we need the code to work before that as well. > I would like to use `var` as a return type placeholder meaning "this method > returns a variable" What does it mean? Far as I know (but of course, my knowledge is limited), there's no var-ref type in Java (nor Groovy), and thus no method can return a variable. Have I missed something of importance again? Thanks and all the best, OC