groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Suderman Keith <>
Subject Re: changing "with" to return self or doto
Date Wed, 06 Jul 2016 14:24:58 GMT
-1 to a breaking change (in 2.5 or 3.0).  I agree with Jason, breaking changes only for methods
that are widely considered to be broken.

-1 to a new method.  While a new method may be better than a breaking change I don’t like
to see Object’s namespace become even more polluted with marginally useful methods.  I don’t
think the current behaviour is so offensive that it requires an additional method on Object;
is `x.with { it }` really that bad?


> On Jul 6, 2016, at 8:20 AM, Jochen Theodorou <> wrote:
> We have an overlap of and
That I would like to discuss.
> Basically 3976 is about making "with" return the object it operates on. Right now we
> assert 1 == x.with {1}
> assert x == x.with {it}
> and after 3976 we would have:
> assert x == x.with {1}
> assert x == x.with {it}
> The mentioned pull request goes with the same logic, but using a new method. My opinion
on this is, that we should go for a breaking change in 2.5 and change "with", instead of adding
another method on Object.
> What do you guys think? Do you agree, or should we keep the current behavior, should
there be a doto method instead?
> PS: just in case some people are wondering... I am trying to get some of our old pull
requests in, there are too many and keeping them open so long is an insult to contributors..
> So if I do not forget about this and if there are no reactions I am going to change "with"
> bye Jochen

Research Associate
Department of Computer Science
Vassar College
Poughkeepsie, NY

View raw message