Function type naming conventions

Dan Smith daniel.smith at oracle.com
Thu Jan 3 13:07:23 PST 2013


On Jan 2, 2013, at 12:23 PM, Brian Goetz <brian.goetz at oracle.com> wrote:

> Function<T,R>          T -> R

The fact that this is not "Function<R,T>" makes me extremely happy. :-)

On Jan 2, 2013, at 4:32 PM, Tim Peierls <tim at peierls.net> wrote:

> I'm sure I'll never remember whether IntFunction is int -> int, T -> int, or int -> T, so it'll trip me up a little each time I read it.

Stephen Colebourne makes a similar comment in the comments list.  His suggestion is to use a different base name for functions that return primitives -- we already have "Predicate" and "Block"; now we just need "IntThingy" and "DoubleThingy".  Stephen suggests "CalcInt", which I don't love, but maybe there's a word out there that nicely conveys the concept much like "Predicate"?

—Dan


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