groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Søren Berg Glasius (GR8Conf EU) <sbglas...@gr8conf.org>
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: www.gr8conf.eu, 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 <ocs@ocs.cz> <ocs@ocs.cz>
Reply: users@groovy.apache.org <users@groovy.apache.org>
<users@groovy.apache.org>
Date: 9. november 2016 at 20.33.17
To: users@groovy.apache.org <users@groovy.apache.org>
<users@groovy.apache.org>, Jochen Theodorou <blackdrag@gmx.org>
<blackdrag@gmx.org>
Subject:  Re: .with() variant that returns the original object

Jochen,

On 9. 11. 2016, at 19:44, Jochen Theodorou <blackdrag@gmx.org> 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,
OC

Mime
View raw message