Another page linked from that, http://www.paulgraham.com/icad.html tries to use lambda with Python and gets it almost-but-not-quite right both times - maybe it's because it was written in 2002 :-)
public static interface a
{
public int a( int a );
}
public static a sum( final int n )
{
return new a() { public int a( int a ) { return a + n; } };
}
public static void main( String[] args )
{
System.out.println( sum( 3 ).a( 5 ) );
}
11 comments
[ 3.1 ms ] story [ 47.4 ms ] threadhttp://dankogai.typepad.com/blog/2006/03/lambda_calculus.htm...
At least 21, listed at http://www.paulgraham.com/accgen.html solving a problem that contains this one.
Func<int, int> Sum(int x) { return y => x + y; }