Hi 219,
I don't quite get that argument:
1. People who don't know Groovy also don't know "def", so they ould
just pick up "fin" at the same time as "def".
2. They also don't know you can write "final" instead of "def" in
Groovy (as someone pointed out before, "final" is solely a modifier
in Java, and cannot be used as a type, as in Groovy).
3. I don't see any examples usinf "final" now, so all new examples
could use "fin".
Cheers,
mg
On 22.07.2018 01:03, J. David Beutel wrote:
Personally, I don't think that having the "fin" keyword alternative
would be good. I think it would discourage usage, as examples get
split between "fin" and "final", and people don't already know what
"fin" means.
Cheers,
11011011
On 07/21/2018 11:50 AM, MG wrote:
Hi guys,
I have been wondering for a while whether Groovy developers use "def"
even if a variable is actually is "final" not only because every
Groovy example code uses "def", but also because "final" as a word is
longer than "def".
Therefore I propose to introduce the shortcut "fin" for "final" in
Groovy.
e.g. to support
class Goo {
fin String name
fin Goo gooParent
Goo(fin String name, fin Goo gooParent) { ... }
String gooGoal(fin x) {
fin y = 2*x
fin int z = x + y
}
}
Cheers,
mg