Function types versus arrays
Zdenek Tronicek
tronicek at fit.cvut.cz
Thu Feb 18 13:12:32 PST 2010
Really? If arrays of function type are not allowed, you are naturally not
allowed to use indexing on varargs:
#int(int) compose(#int(int)... fns) {
fns[0] = ... // this is not allowed
}
But you are right, this has been discussed here.
Z.
--
Zdenek Tronicek
FIT CTU in Prague
Alex Buckley napsal(a):
> No.
>
> 1) No-one says function types are implemented as interfaces in Lambda.
>
> 2) Even if function types were implemented as interfaces, they would be
> implemented with generic interfaces, and then lack of reification for
> generics bites you. Other mails explain the problem.
>
> Alex
>
> Zdenek Tronicek wrote:
>> Could you have arrays allowed in JVM and disallowed in the language?
>> On the JVM level, function types are implemented as interfaces. So,
>>
>> #int(int)... fns
>>
>> would have been compiled as array but you were not allowed to write
>>
>> #int(int)[] fns.
>>
>> Z.
>
More information about the lambda-dev
mailing list