A syntax option (function types versus arrays)

Joshua Bloch jjb at google.com
Mon Mar 1 16:58:54 PST 2010


Neal,

On Mon, Mar 1, 2010 at 4:14 PM, Neal Gafter <neal at gafter.com> wrote:

>
>
> > Safe or not, I think it's highly desirable that we be able to express the
> > type that represents an array of function types.  Otherwise function
> types
> > will be second-class citizens: you can (to the best of my knowledge)
> express
> > arrays of every other Java type. This is not the sort of invariant to
> give
> > up lightly.
>
> If we add exception transparency, I expect we will do so by adding
> disjunction types, and you will not be able to express arrays of those
> either (never mind intersection types).
>

Why do you say we won't be able to express arrays of disjunction types? Is
there some fundamental reason it's not possible?  If so, then yes, they'd be
second-class citizens (if we decided to support them). But that's no reason
to turn function types into second class citizens when we have a choice in
the matter.

            Josh


More information about the lambda-dev mailing list