riven8192 / LibStruct

64 stars 3 forks source link

Java 8 Lambda Support #10

Open ra4king opened 9 years ago

ra4king commented 9 years ago

Lambdas are very clean and easy to use. I have some areas that could benefit visually from this (turning 6 lines in 1!). Hopefully this isn't too much work, however I'm definitely interested in helping out.

riven8192 commented 9 years ago

Remember most utility methods around Lambda work with interfaces that use generics. Structs and generics don't mix at all, as structs are not class-types but raw pointers. Using Lambda expressions in a method that also uses structs however, shouldn't be too hard to add.

riven8192 commented 9 years ago

See commit: https://github.com/riven8192/LibStruct/commit/fc8cd3092aa765cbe25cc0e9b8c98a48e279bf3a

ra4king commented 9 years ago

Thanks a bunch! https://github.com/ra4king/OpenGL-Worlds/commit/fa67429ab93aac476708643ed1e72b5bd993b9da

riven8192 commented 9 years ago

Keep in mind the support is minimal. Lambdas with structs will either crash the transformer or the JVM bytecode verifier.