5 ms·
Java functions are still not first class. The headline feature of Java 8 was lambda function, which arguably isn't first class either (they are implemented as i
by NhanH 11y ago
Java functions are still not first class. The headline feature of Java 8 was lambda function, which arguably isn't first class either (they are implemented as instances of object subtype, so essentially still is object nonetheless)
- adrusi 11y agoThey also don't close over their parent scope.
- deleted 11y ago[deleted]
- jnericks 11y ago// this hack is gross final String[] val = new String[1]; Callable func = () -> val[0] = "Hello"; func.call(); System.out.print(val[0]);
- steveklabnik 11y ago> so essentially still is object nonetheless http://www.c2.com/cgi/wiki?ClosuresAndObjectsAreEquivalent http://www.c2.com/cgi/wiki?ClosuresAndObjectsAreEquivalent