Forms for reduce() -- part 1

Brian Goetz brian.goetz at oracle.com
Fri Dec 14 13:24:20 PST 2012


I thought was using "so" to mean "I agree with your conclusion, but not 
your assumption, but here's an alternate reasoning that supports your 
conclusion anyway" :)

I think "mutableReduce" is a fair balance between a small number of 
extra characters and some extra meaning.

On 12/14/2012 4:15 PM, Tim Peierls wrote:
> 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
> <mailto: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>
>         <mailto: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