Re:Java 7 New Features
by domlebo70 on Sunday December 23, 2012 @06:47AM
(#4959264)
Christ these are features we should be excited for? Give us proper lambdas. Give us pattern matching on types with extraction. Give us first class functions. Give us higher kinded generics so we can stop duplicating code. None of these things are impossible to do without breaking compatibility, so just do it already.
[ Parent
| on HN ]
Re:Java 7 New Features
by InclinedPlane on Sunday December 23, 2012 @07:55AM
(#4959360)
Popular languages with lambdas/closures/first class functions:
Ruby, Python, C#, Objective-C, Javascript, C++ 11
...
PHP
If you happen to find yourself being the personification of a programming language, and if you discover that PHP is a more advanced language than yourself then you have my permission to spend a night drinking heavily before hanging yourself from a lamp cord tied to a rafter in the garage.
Re:Java 7 New Features
by gurkendoktor on Sunday December 23, 2012 @08:12AM
(#4959382)
Apple's blocks are not even limited to just Objective C, they're designed to work with C as well. (They're still not a standard feature, of course).
Clojure too classifies as "popular" I guess.
But I forgot this was HN: the place where people are allergic to homoiconicity ; )
These features are already possible with the existing byte code in JVM 6. Because it is all implement and possible using Scala.
But all of those things are accomplished using plain Java (I.e. a Function1<InputType, OutputType>) and classes with static methods for objects etc. It's not done at a bytecode level. You can do everything you can do in Scala... in Java, it's just hilariously verbose.