Removal of function types

Pavel Minaev int19h at gmail.com
Wed Jul 7 21:40:38 PDT 2010


I think the meaning is something along the lines of C++ template
parameter packs & their expansions in various context, which would
allow you to write something like:

   interface Func<R, A...> {
        R invoke(A... a);
   }

   Func<String> f0;
   Func<String, Integer> f1;
   Func<String, Integer, Boolean> f2;
   ...

I don't see how it would help, though, so long as type parameters
cannot be primitive types. You'd still need IntAndIntToLong and
friends.And it doesn't really buy much over Func0<R>, Func1<R, A1>,
..., up to some sufficiently high N (what is it these days in .NET for
System.Func, 16 arguments? I haven't heard complaints about it being
too low).


On Wed, Jul 7, 2010 at 9:27 PM, Neal Gafter <neal at gafter.com> wrote:
>
> "veridic genetics" is an interesting pair of words, but I have no idea what that would mean as a language construct, or how it would help address any of the issues here.  Please tell us more.
>
> -Neal
>
> On Jul 7, 2010, at 4:17 PM, "Nathan Bryant" <nathan.bryant at linkshare.com> wrote:
>
> > Perhaps there is an alternative middle ground, that would provide
> > function types but make them look like SAM's: variadic generics.
> >
> > Wink wink, nudge nudge.
> >
> >
> > -----Original Message-----
> > From: lambda-dev-bounces at openjdk.java.net
> > [mailto:lambda-dev-bounces at openjdk.java.net] On Behalf Of Doug Lea
> > Sent: Wednesday, July 07, 2010 7:06 PM
> > To: lambda-dev at openjdk.java.net
> > Subject: Re: Removal of function types
> >
> > On 07/07/10 13:18, Stephen Colebourne wrote:
> >> I suggest using this thread to comment on the removal of function
> > types :-)
> >>
> >
> > As one of the instigators-by-counter-example of function types,
> > I do wonder what the plan is for providing dozens if not
> > hundreds of SAM types for (parallel) aggregate operations.
> > As in my infamous workarounds at:
> > http://gee.cs.oswego.edu/dl/jsr166/dist/extra166ydocs/extra166y/Ops.html
> >
> > -Doug
> >
> >
> >
>


More information about the lambda-dev mailing list