A syntax option (function types versus arrays)
Joshua Bloch
jjb at google.com
Tue Mar 2 09:55:59 PST 2010
Peter,
On Tue, Mar 2, 2010 at 12:10 AM, Peter Levart <peter.levart at marand.si>wrote:
>
> > > static <T,U,V,X extends Throwable>
> > > (T->(U throws X->V)) curry((T,U throws X->V) function) {
> > > return (T t->(U u->function.(t,u)));
> > > }
> <snip>
> >
> > That's pretty good in my eyes - for these non-trivial types I think it's
> much easier to follow than the equivalent code using the currently proposed
> syntax.
>
<snip>
Beauty is in the eye of the beholder. It doesn't look at all like Java to
me, and that's a Cardinal when extending a language. Our primary goal is to
design a facility that's recognizable and comfortable to current-day Java
programmers.
>
> I also think that it is good that this syntax doesn't abuse '#' for yet
> another thing. There's already non-java identifiers and method references
> that use it. Adding function types and lambdas to the mix increases
> confusion as everything looks similar.
But the language doesn't have method references. And non-Java identifiers
aren't supposed to occur in programs that humans will be reading, only in
machine generated code.
In sum, I don't find these arguments all that convincing.
Josh
More information about the lambda-dev
mailing list