groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guillaume Laforge <glafo...@gmail.com>
Subject Re: Safe index for Groovy 3
Date Tue, 08 Nov 2016 16:21:34 GMT
A few times I've wanted to have safe index.
Sounds like a good idea.

On Tue, Nov 8, 2016 at 5:08 PM, Daniel Sun <realbluesun@hotmail.com> wrote:

> Hi all,
>
>       The new parser supports safe index now, which is proposed by Paul
> King
> :)
>
>       Here are some example code:
>
> assert null == null?[1];
> assert null == null?[1]?[1, 2];
> assert null == null?[1]?[1, 2]?[1, 2, 3];
>
> def a = null;
> assert null == a?[1, 2];
>
> def f() {return null}
> assert null == f()?[1];
>
>        More information can be found at the safeIndex branch of
> groovy-parser
> project(https://github.com/danielsun1106/groovy-parser/tree/safeIndex)
>
>        Any thoughts?
>
>        BTW, the antlr4 branch of apache/groovy is very old, I am going to
> try to update it with the master.
>
> Cheers,
> Daniel.Sun
>
>
>
>
>
> --
> View this message in context: http://groovy.329449.n5.
> nabble.com/Safe-index-for-Groovy-3-tp5736558.html
> Sent from the Groovy Dev mailing list archive at Nabble.com.
>



-- 
Guillaume Laforge
Apache Groovy committer & PMC Vice-President
Developer Advocate @ Google Cloud Platform

Blog: http://glaforge.appspot.com/
Social: @glaforge <http://twitter.com/glaforge> / Google+
<https://plus.google.com/u/0/114130972232398734985/posts>

Mime
View raw message