Function types versus arrays
Neal Gafter
neal at gafter.com
Sun Feb 7 10:41:18 PST 2010
I've been asked if arrays and function types will play nicely
together. Specifically, for example, whether or not something like
the following will be allowed:
#String(String)[] arrayOfFunction = new #String(String)[10];
The current draft spec, by the absence of any constraining rules,
implies yes. But if I have to guess, I would say the end result of
project lambda will probably say no. Although we haven't talked much
about implementation techniques, I'm not aware of any proposed
implementation technique that would allow this without opening a hole
in the type system.
I don't know whether we should consider this important or not (I
don't; I'm perfectly happy using java.util.List), but if it is
important then someone should be thinking about what needs to happen
(VM support?) to make it work.
Cheers,
Neal
More information about the lambda-dev
mailing list