6 ms·
If they wrote java with closures people would understand it as well. Instead they used more complicated examples for java which skews the results. Example if yo
by username90 6y ago
If they wrote java with closures people would understand it as well. Instead they used more complicated examples for java which skews the results. Example if you translate their lisp example directly.
Their original lisp:
( let ([ x 3])
( let ([ f ( lambda (y ) (+ x y ))])
( let ([ x 5])
(f 10))))
Java:
{ int x = 3;
{ Function<Integer,Integer> f = y -> y + x;
{ int x = 5;
{ return f.apply(10); }}}}
They argued that Java is less concise so they couldn't have as many examples, but I feel that example gets the point across just as well and it has comparable number of characters.