-1, it can be easily done as:

list.first() ?: defaultValue


p

On Thu, Oct 18, 2018 at 6:45 PM Daniel.Sun <sun...@apache.org> wrote:

> +0 from me.
> P.S. we should add similar DGM for `last` too?
>
> Cheers,
> Daniel.Sun
>
>
>
>
> -----
> Daniel Sun
> Apache Groovy committer
> Blog: http://blog.sunlan.me
> Twitter: @daniel_sun
>
> --
> Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html
>

Reply via email to