groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alessio Stalla <alessiosta...@gmail.com>
Subject Re: Swift's autoclosure in Groovy ?
Date Wed, 27 May 2015 13:50:50 GMT
As far as I understand it, it doesn't merely *avoid *explicit
wrapping, it *forbids
*it, and thus it is, IMHO, a bad feature.

On Wed, May 27, 2015 at 3:43 PM, Rhangaun . <rhangaun@outlook.com> wrote:

> Of course you can wrap the computation at the call-site, @autoclosure
> avoid the explicit wrapping.
>
> ------------------------------
> Date: Wed, 27 May 2015 15:31:32 +0200
> Subject: Re: Swift's autoclosure in Groovy ?
> From: maciek.gorski@gmail.com
> To: users@groovy.incubator.apache.org
>
>
> Wouldn't something like this:
>
> foo(someLongCalculation("One"), someLongCalculation.curry("Two"))
>
> def foo(Integer x, Closure<Integer> y) {}
>
> be equivalent?
>
>
>
> 2015-05-27 15:16 GMT+02:00 Rhangaun . <rhangaun@outlook.com>:
>
> Has someone given a thought about adding someting equivalent to Swift's
> autoclosure annotation in Groovy ?
>
>
> http://www.archgrove.co.uk/weblog/2014/06/09/swift-semantics-auto-closing-over-parameters
>
>
>
>

Mime
View raw message