groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Kleeh <james.kl...@gmail.com>
Subject Re: .with() variant that returns the original object
Date Wed, 09 Nov 2016 20:47:43 GMT
What about something like object.build { } ?

> On Nov 9, 2016, at 3:45 PM, Jordan Martinez <jordanalexmartinez@gmail.com> wrote:
> 
> 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 <mailto:paulk@asert.com.au>>
wrote:
> On Thu, Nov 10, 2016 at 12:02 AM, C├ędric Champeau
> <cedric.champeau@gmail.com <mailto: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