1. 12

  2. 2

    Is the reason known why the Android API has some stuff from the java.lang.invoke package but not LambdaMetafactory which would apparently allow native Lambdas without desugaring?

    1. 1

      This is a pretty in-depth article. I had no idea this was going on, I was just using source JAVA_1_8. Once in a while, I stopped and tried to reason why is that I can use Java 1.8 syntax, yet I cannot use Java 1.8 library features (like new date/time classes) while developing for Android. I did not have the ‘why’ – this article explains it.

      WRT, > “.. The banner language feature of Java 8 was by far the addition of lambdas. This brought a more terse expression of code as data whereas previously more verbose constructs like anonymous classes would be used. ..”

      My appreciation of the lambdas (in Java and C++) really came when I started doing asynch networking libs, and UI libs with many call backs.

      Lambdas allow to keep the callbacks code, neatly, together with the invocation flow. This is a massive improvement in readability.

      I think older C++ libraries (like wxWindows, and even Qt) would have been massively simpler to use/follow if, at the time they were built, C++ had lambdas.