3 ms·
>If you want to make a first-class function, you need a classfile, a class, and an actual full-blown object for that function. this isn't wholly true as of jav
by oldmanjay 12y ago
>If you want to make a first-class function, you need a classfile, a class, and an actual full-blown object for that function.
this isn't wholly true as of java 8. dynamic invocation is used to implement the new lambda facility.
- oldmanjay 12y agoreplying to myself to add info, in case anyone stumbles across this. I was only half correct - the current implementation does generate a dynamic invocation in bytecode, but the bootstrap framework that binds the call site ends up generating a class at runtime to "seal the deal" as it were. I hadn't read through all the details before now. one source with many links: http://www.takipiblog.com/compiling-lambda-expressions-scala-vs-java-8/ http://www.takipiblog.com/compiling-lambda-expressions-scala...