You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2019/11/22 15:55:00 UTC

[jira] [Updated] (GROOVY-9308) [Parrot] support let or val keyword, aka "final var"

     [ https://issues.apache.org/jira/browse/GROOVY-9308?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Milles updated GROOVY-9308:
--------------------------------
    Summary: [Parrot] support let or val keyword, aka "final var"  (was: [PARROT] Support val/let keyword, aka "final var")

> [Parrot] support let or val keyword, aka "final var"
> ----------------------------------------------------
>
>                 Key: GROOVY-9308
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9308
>             Project: Groovy
>          Issue Type: Wish
>            Reporter: Matthias Fuchs
>            Priority: Minor
>
> I'm a long time java developer and I'm used to add "final" to my variable definition: final var name = "a"
> I think the "var" keyword itself helps a lot, but seeing "var" and "final var" not being alligned properly in code makes me crazy ;)
> As we have *def* and *var* in groovy, wouldn't it be nice to have a *val* or *let* in groovy too, that is just a short form of "*final var*"?
> Although personally I would prefer "val" I do understand that some people might have problems differentiating "var" and "val", hence the "let".
> Imagine:
> {code:java}
> var destination = "Wien"
> val country = "AT"{code}
> instead of:
> {code:java}
> var destination = "Wien"
> final var country = "AT"{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)