groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Søren Berg Glasius (GR8Conf EU) <>
Subject Re: .with() variant that returns the original object
Date Wed, 09 Nov 2016 19:44:11 GMT
I know, that I depend on a with{} returning what I make it return, so
making it return null or another value would be bad.

Best regards,
Søren Berg Glasius
GR8Conf Europe organizing team

GR8Conf ApS
Mobile: +45 40 44 91 88, Web:, Skype: sbglasius
Company Address: Buchwaldsgade 50, 5000 Odense C, Denmark
Personal Address: Hedevej 1, Gl. Rye, 8680 Ry, Denmark
--- GR8Conf - Dedicated to the Groovy Ecosystem

From: OC <> <>
Reply: <>
Date: 9. november 2016 at 20.33.17
To: <>
<>, Jochen Theodorou <>
Subject:  Re: .with() variant that returns the original object


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