Function type naming conventions (original) (raw)

Brian Goetz brian.goetz at oracle.com
Wed Jan 23 13:24:38 PST 2013


Agreed. (Which is the same conclusion we had the last several times Remi brought this issue up :)

On 1/23/2013 4:22 PM, Tim Peierls wrote:

On Wed, Jan 23, 2013 at 3:34 PM, Remi Forax <forax at univ-mlv.fr_ _<mailto:forax at univ-mlv.fr>> wrote:

> UnaryOperator extends Function<T,T> > BinaryOperator extends BiFunction<T,T,T> UnaryOperator should be Operator and BinaryOperator should be BiOperator, it's just more regular. Operator extends Function<T,T> BiOperator extends BiFunction<T,T,T>

The reason to have these "convenience" types in the first place is so they'll be easy to remember and recognize. The term "function" is much more commonly used to mean "function of one argument", so Function/BiFunction is better than UnaryFunction/BinaryFunction. The term "operator" skew more evenly between unary and binary, so UnaryOperator/BinaryOperator is better than Operator/BiOperator. --tim



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