Forms for reduce() -- part 1 (original) (raw)
Doug Lea dl at cs.oswego.edu
Fri Dec 14 13:23:48 PST 2012
- Previous message: Forms for reduce() -- part 1
- Next message: Forms for reduce() -- part 1
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 12/14/12 16:15, 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?
This is exactly the same case as with CompletableFutures, where having actiony completions and functiony continuations are about equally common, so just overloading seemed fine to everyone?
-Doug
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
- Previous message: Forms for reduce() -- part 1
- Next message: Forms for reduce() -- part 1
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the lambda-libs-spec-experts mailing list