groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guillaume Laforge <glafo...@gmail.com>
Subject Re: changing "with" to return self or doto
Date Wed, 06 Jul 2016 15:04:31 GMT
If we are to add a new method in 2.5 or 3.0 (we should definitely not
change the behavior of with{} IMHO), I really like "tap" as a name.

On Wed, Jul 6, 2016 at 4:53 PM, Juan Vazquez <juanvazquez@gmail.com> wrote:

> Tim Yates created an extension module for tap.
>
>
> https://github.com/timyates/groovy-common-extensions/blob/master/src/main/groovy/com/bloidonia/groovy/extensions/ObjectExtensionMethods.groovy
>
> Thanks,
> Juan
>
> On Wed, Jul 6, 2016 at 9:41 AM, Jochen Theodorou <blackdrag@gmx.org>
> wrote:
>
>>
>>
>> On 06.07.2016 16:24, Suderman Keith wrote:
>>
>>> -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.
>>>
>>
>> if no breaking changes even in a new major version, then when?
>>
>>
>>> -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?
>>>
>>
>> yes, I feel the namespace for Object is too polluted already as well.
>>
>> bye Jochen
>>
>
>
>
> --
> -Juan
>



-- 
Guillaume Laforge
Apache Groovy committer & PMC Vice-President
Developer Advocate @ Google Cloud Platform

Blog: http://glaforge.appspot.com/
Social: @glaforge <http://twitter.com/glaforge> / Google+
<https://plus.google.com/u/0/114130972232398734985/posts>

Mime
View raw message