More questions / function type hierarchy (was: Re: Method calls vs lambda calls)

Stefan Schulz schulz at the-loom.de
Thu Dec 17 00:32:07 PST 2009


Neal Gafter wrote:
> Yes: a variable is added to the method namespace only when declared with
> a function type.  In this example, t and t1 are not declared with a
> function type, but rather are declared with the type of a type parameter
> (T).  Therefore shorthand invocation is not available for them.
>
> This is a nice solution because it prevents names being inherited into a
> namespace in which they did not previously appear.

Allowing function types for generic parameters and the above issue 
raises some questions in my eyes (maybe not to be answered right now, 
but to be put on a lambda-questionaire):
* would something like <T extends #int(int)> be allowed?
* if the above, what types will fulfill T?
* would it make sense to have some notation or supertype denoting a 
generic parameter to be of any function type (e.g. <T extends #?>)?

IMHO, similar questions arise for method overriding and co-variance of 
return types.

Cheers,
Stefan


More information about the lambda-dev mailing list