groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jordan Martinez <jordanalexmarti...@gmail.com>
Subject Re: .with() variant that returns the original object
Date Wed, 09 Nov 2016 20:45:00 GMT
What about `object.itselfWith(Closure)`? Then its understood as returning
the object itself but with the changes that follow.

Blessings,
Jordan

On Wed, Nov 9, 2016 at 12:32 PM, Paul King <paulk@asert.com.au> wrote:

> On Thu, Nov 10, 2016 at 12:02 AM, C├ędric Champeau
> <cedric.champeau@gmail.com> wrote:
> > I agree with what Jason said. I'm still up for `tap`. We could use
> > `with(true) { ... }`, but I also dislike "with(returnThis: true) {... }"
> > because it's not type safe.
>
> If we progress GROOVY-7956, we'd have type safety but I agree with you
> anyway. And it should be returnImplicitThis or returnSelf or something
> anyway.
>
> Cheers, Paul.
>

Mime
View raw message