Lambda expressions vs Diamond

Mark Mahieu mark at twistedbanana.demon.co.uk
Sat Nov 21 20:27:34 PST 2009


I'm wondering whether Diamond could/should be useable with lambda expressions, for example:

	#int(Collection<SomeLongType>) foo = #(Collection<> c) c.size();

I can imagine people intuitively expecting that to work, depending on whether they think of lambda expressions as objects with a type first and foremost, or as functions with a signature.

One downside though - if 'foo' above had been declared as a normal interface type, it would become more difficult to understand the type of 'c' (not that it's relevant in this example).


Mark



More information about the closures-dev mailing list