groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Sun <realblue...@hotmail.com>
Subject Elvis Assignment for Groovy 3
Date Sat, 03 Dec 2016 07:59:37 GMT
Hi all,

       The new parser "Parrot" supports Elvis Assignment(i.e.  ?=) now. Here
are some examples:

    def a = 2
    a ?= 1
    assert a == 2

    a = null
    a ?= 1
    assert a == 1

    a = null
    a ?= a ?= 1
    assert a == 1

P.S. supports static compilation as well. 

Cheers,
Daniel.Sun




--
View this message in context: http://groovy.329449.n5.nabble.com/Elvis-Assignment-for-Groovy-3-tp5737108.html
Sent from the Groovy Dev mailing list archive at Nabble.com.

Mime
View raw message