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




Reply via email to