Bikeshed: what do we call the distinguished method of a SAM?

Brian Goetz brian.goetz at oracle.com
Tue Jul 2 15:14:01 PDT 2013


Here's a webrev of the current state of this re-spec, covers all the SAMs:

   http://cr.openjdk.java.net/~briangoetz/tmp/webrev/



On 7/2/2013 3:44 PM, Brian Goetz wrote:
> Working on the spec for the SAMs.  In consultation with Doug, converging
> on a style that casts a SAM as *representing* an abstract entity such as
> a function or operation, and treating the SAM *as if* it were that
> function.  For example:
>
> /**
>   * Represents a function that accepts one argument and produces a result.
>   *
>   * @param <T> the type of the input to the function
>   * @param <R> the type of the result of the function
>   *
>   * @since 1.8
>   */
> @FunctionalInterface
> public interface Function<T, R> {
>
>      /**
>       * Applies this function to an argument.
>       *
>       * @param t the function argument
>       * @return the function result
>       */
>      R apply(T t);
>
> I think one thing that is missing is tying together the sole SAM method
> with the SAM class.  This is obvious in a SAM with no default or static
> methods (and no methods from Object), but starts to get lost in the
> noise as the method count adds up.
>
> I'm thinking of something like:
>
>   * This is a <a href="...">functional interface</a> whose _____ method
> is {@link #apply}.
>
> For some value of ____.  What do we call the primary SAM method?  The
> implementation method?  The primary SAM method?  The abstract method?
>


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