groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guillaume Laforge <glafo...@gmail.com>
Subject Re: [RFE] Methods as expressions
Date Wed, 21 Mar 2018 08:46:27 GMT
Another case is a method / function that returns a closure, would we allow
the syntax:

def m(String x, int y) = { x * y }

?

On Wed, Mar 21, 2018 at 3:46 AM, Daniel Sun <realbluesun@hotmail.com> wrote:

> Hi C├ędric,
>
>      If method throws exception, what does your proposed syntax look like?
> For example,
>
>
> ```
> def m(String x, Integer y) throws IOException {
>     readSomeFile(..)
> }
> ```
>
> is equivalent to the following code?
>
> ```
> def m(String x, Integer y) throws IOException = readSomeFile(..)
> ```
>
> Cheers,
> Daniel.Sun
>
>
>
>
> --
> Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html
>



-- 
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