Function type naming conventions (original) (raw)

Kevin Bourrillion kevinb at google.com
Tue Jan 29 10:31:02 PST 2013


All right, how many mistakes am I already making here? :-)

(I keep forgetting if there is a url where I can browse the very-latest lambda sources as checked in.)

Functions: *

To Object To int To doubleFrom Object Function ToIntFunction ToDoubleFunction From int IntFunctionIntToIntFunction IntToDoubleFunction From doubleDoubleFunction DoubleToIntFunction DoubleToDoubleFunction

BiConsumers:* * Then Object Then int Then doubleFirst Object BiConsumer ObjIntConsumer ObjDoubleConsumer First int -IntIntConsumer* IntDoubleConsumer First double-

On Tue, Jan 29, 2013 at 9:36 AM, Brian Goetz <brian.goetz at oracle.com> wrote:

Still some holes, e.g., doesn't tell me which of the following is right:

ObjObjToIntFunction BiToIntFunction ToIntBiFunction The second one is definitely wrong because we put type modifiers first. So somewhere it should say: [ type arg specializations ] [ return specialization ] [ arity ] base Of the remaining (and many like it), there are always going to be multiple ways to name the same thing. So its not that (1) is wrong and (3) is right. Both are consistent (as is ObjObjToIntBiFunction). But we should have some rules for which we prefer. --tim On Tue, Jan 29, 2013 at 12:06 PM, Paul Sandoz <paul.sandoz at oracle.com_ _<mailto:paul.sandoz at oracle.com**>> wrote:

On Jan 29, 2013, at 5:48 PM, Kevin Bourrillion <kevinb at google.com_ _<mailto:kevinb at google.com>> wrote: Does anyone have a complete and current taxonomy of where exactly we've ended up with all this (leaving out all the history of how we got here)?

Does the following suffice? http://hg.openjdk.java.net/lambda/lambda/jdk/file/ 5d4167b7bf8c/src/share/**classes/java/util/function/**package-info.java<http://hg.openjdk.java.net/lambda/lambda/jdk/file/5d4167b7bf8c/src/share/classes/java/util/function/package-info.java> Paul.

On Thu, Jan 24, 2013 at 2:47 PM, Tim Peierls <tim at peierls.net_ _<mailto:tim at peierls.net>> wrote: On Thu, Jan 24, 2013 at 5:20 PM, Joe Bowbeer <joe.bowbeer at gmail.com <mailto:joe.bowbeer at gmail.com>**>wrote:

+1 ObjIntBlock (or a more descriptive "Block" name if one is selected)

Agreed. Works well in conjunction with Dan Smith's suggestion ('if the base type is parameterized in both its parameters and return, then the "To" prefix is mandatory. If not, "To" is not used.'), omitting To and Bi where they aren't needed. --tim

-- Kevin Bourrillion | Java Librarian | Google, Inc. | kevinb at google.com <mailto:kevinb at google.com>

-- Kevin Bourrillion | Java Librarian | Google, Inc. | kevinb at google.com



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