Forms for reduce() -- part 1

Tim Peierls tim at peierls.net
Fri Dec 14 13:15:43 PST 2012


That was an example of the use of "so" to mean "no", wasn't it? :-)

So really grody names are out. Is there something better than reduceMutably?


On Fri, Dec 14, 2012 at 4:09 PM, Brian Goetz <brian.goetz at oracle.com> wrote:

> So, right now most inject-style use cases will be mutable, since the
> containers we have (ArrayList, StringBuilder) are mutable.  Over time, we
> will likely see more immutable data structures, so maybe over time the
> problem solves itself.
>
>
> On 12/14/2012 4:03 PM, Tim Peierls wrote:
>
>> On Fri, Dec 14, 2012 at 3:15 PM, Brian Goetz <brian.goetz at oracle.com
>> <mailto:brian.goetz at oracle.com**>> wrote:
>>
>>             So, the question remains -- is the word "mutable" (or some
>>             other way of saying that) a helpful guide about what is
>>             being done here, or pedantic noise that will irritate the
>>             users?  (Note that I think we should care much less how it
>>             makes people feel when *writing* code than how it helps
>>             comprehension when *reading* code.)
>>
>>
>> I don't think it's noise. It's going to be less common to come across
>> "mutable" forms in practice, since they'll be harder to work with
>> and will typically have to be wrapped in something more friendly.
>> (That's my prediction, anyway.) So I think long descriptive names are
>> fine here, like reduceThroughSideEffects or reduceHereBeDragons.
>>
>> --tim
>>
>


More information about the lambda-libs-spec-observers mailing list