groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul King <pa...@asert.com.au>
Subject Re: About supporting `var` of Java10+
Date Thu, 08 Mar 2018 11:26:23 GMT
What are peoples thoughts. Should we try to make "def" and "var" exactly
aliases? Or almost?
If we do, we need to add some info in the differences from Java section of
the doco to explain the differences with Java's upcoming "var".
If we don't, we need to articulate some good reasons for making the
distinction.
I am leaning slightly towards the former but I can see arguments for both
sides. In any case I am interested in others thoughts.
At a minimum, I'd like to see both ""def" and "var" recognised as reserved
type names in the grammar rather than keywords.
Any thoughts?


Cheers, Paul.


On Thu, Mar 8, 2018 at 7:57 PM, Jochen Theodorou <blackdrag@gmx.org> wrote:

>
>
> Am 08.03.2018 um 09:44 schrieb mg:
>
>> @unless you reassign, you would not notice the difference between current
>> def and the Java var:
>> 1) If I don't need to reassign, I would use final instead of var :-)
>> 2) Supporting var for fields that get initialized during declaration,
>> also would feel very Groovy to me, although I personally would not expect
>> to use that a lot.
>>
>
> they decided against using final and instead go with semi-final.
>
> bye Jochen
>

Mime
View raw message