Function types versus arrays
Joshua Bloch
jjb at google.com
Thu Feb 18 11:44:05 PST 2010
Neal,
Perhaps I'm being naive, but it appears to me that allowing:
#int(int) compose(#int(int)... fns) { <implementation> }
implies the existence of arrays of (erased) function types. I thought you
were arguing against the very existence of types representing arrays of
function types. Alex's suggestion that these types be treated analogously to
arrays of other nonreifiable types (i.e., most generic and parameterized
types) makes good sense to me.
Josh
On Thu, Feb 18, 2010 at 9:45 AM, Neal Gafter <neal at gafter.com> wrote:
> On Wed, Feb 17, 2010 at 2:59 PM, Joshua Bloch <jjb at google.com> wrote:
> > consider a method that takes a bunch of #int(int) functions and
> > returns their composition:
> > #int(int) compose(#int(int)... fns) { <implementation> }
> > This should definitely be legal, and shouldn't generate a warning
> > (especially given that we're providing a means to eliminate this sort of
> > warning on generic varargs parameters in Java 7).
>
> This doesn't conflict with any of the restrictions I proposed.
>
More information about the lambda-dev
mailing list