groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From OC <>
Subject Re: .with() variant that returns the original object
Date Wed, 09 Nov 2016 19:33:12 GMT

On 9. 11. 2016, at 19:44, Jochen Theodorou <> wrote:
> Also it should be noted that we already have an alias for "with", which is "identity".
I would not want to have yet another one.
> Frankly... I think we should change what it returns.

whilst I agree too many aliases is a bad thing, in my personal opinion, breaking backward
compatibility is worse.

> It is unlikely somebody did depend on with returning null.

I might be wrong as so often, but I can well imagine somebody depends on the current behaviour,
which, far as I understand, is not returning null, but returning the result of the last expression
in the closure -- precisely what I would myself like to be available in future as "resultWith".

All the best,

View raw message