groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alessio <aless...@gmail.com>
Subject Re: "External" closures, why?
Date Wed, 02 Dec 2015 00:14:36 GMT
>
> yes

Thanks.

>
> the problem simply is that while(x, {doSomething()}) looks quite ugly ;)

It absolutely does, agreed (but then all these inlined functions do in
most languages :) ).
Nonetheless, while visually maybe not appealing, I'd argue it makes
semantically more sense to have it in that place than "suddenly"
outside of the function call.

And yes, I understood that the regular way is still possible, my
"complaint" was rather about this additional alternative, which really
left me staring at the screen for a good while today (possibly
similarly as when I discovered Angular's insanity of using the
argument names for dependency injection - different subject though).

Anyhow, thanks for having taken the time to explain the details.

>
> if ultimate means last argument, then yes ;)

It does :)
Thanks for the clarification.

So, just for yet another better understanding, whenever there is a
code block (-> closure) after a function call, it automatically gets
appended as additional argument?

Mime
View raw message