overload patterns/anti-patterns (original) (raw)
Brian Goetz brian.goetz at oracle.com
Sat Dec 29 06:59:49 PST 2012
- Previous message: overload patterns/anti-patterns
- Next message: overload patterns/anti-patterns
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
My current sense is that, no matter how much lambda-overload matching is tweaked, this will remain a common API design gotcha, and the best advice is to never overload solely on function type.
... where the function types have the same arity.
There's no hazard to overloading
foo(Function) and foo(BiPredicate)
Similarly, it is a key goal to make overloading on specialized return type safe, because we want to support constructions like:
Stream map(Function<T,U>) and IntStream map(IntFunction)
- Previous message: overload patterns/anti-patterns
- Next message: overload patterns/anti-patterns
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the lambda-libs-spec-experts mailing list