> On Nov 8, 2016, at 11:41 AM, Jochen Theodorou <[email protected]> wrote:
> 
> what about an overloaded with:

+1

Or even something like:

myObject.with { ... } // current behaviour
myObject.with(return:this) { ... } // returns this when finished.
myObejct.with(return:new Object()) { ... } // returns a new Object when 
finished.

This particular syntax would take a bit of extra parser arm waving since the 
`return` keyword is being used differently in this context.

Keith

> 
>>> myObject.with(true) {
>>>    // some code
>>> }
> 
> or:
> 
>>> myObject.with(returnThis:true) {
>>>    // some code
>>> }
> 
> or... well I am sure there are many variants... just want to know if 
> something like this doesn't cut it.
> 
> bye Jochen

Reply via email to