News for hackers. Stuff that matters.
Re:Java 9 with GPU processing, Java 10 will be all-OOP witho... by CodeMage on Friday March 30, 2012 @08:18AM (#3775560)
Classes are already objects. I don't know whether Java 8 will finally introduce function as a data type, but if it does, I'm pretty sure they won't do it the way Ruby blocks work (i.e. block is not an object).
Re:Java 9 with GPU processing, Java 10 will be all-OOP witho... by EdiX on Friday March 30, 2012 @08:53AM (#3775684)
I'd rather they didn't. It would be redundant with inner classes that are already there, I don't like this piling up of features. It would be more interesting if they allowed inner classes to close over non-final variables.
Re:Java 9 with GPU processing, Java 10 will be all-OOP witho... by ramblerman on Friday March 30, 2012 @09:39AM (#3775849)
An inner class is the ugly half-brother of a closure. 99% of the time they're used they define just one method.

When they are used for more than 1 method implementations, well ... they shouldn't be inner classes.

They just exist to fill the gap of having no closures. I say this as a long time and affectionate java user but project lambda in JDK8 is long overdue.

Re:Java 9 with GPU processing, Java 10 will be all-OOP witho... by yummyfajitas on Friday March 30, 2012 @11:05AM (#3776251)
When they are used for more than 1 method implementations, well ... they shouldn't be inner classes.

Why not? Very often, a class will have some data members which are pretty much meaningless elsewhere. Why should the class used to represent that data be exposed elsewhere?

Re:Java 9 with GPU processing, Java 10 will be all-OOP witho... by EdiX on Friday March 30, 2012 @10:00AM (#3775936)
They are there, they have been there for over ten years, much code exists that needs them to be there. You can't take them out of the language.

More syntax sugar for them would be good, adding first class functions IMHO isn't good.

Re:Java 9 with GPU processing, Java 10 will be all-OOP witho... by rukkyg on Friday March 30, 2012 @08:27AM (#3775594)
Aren't methods already an object of class java.lang.reflect.Method? Do you mean you should be able to do something like foo(PrintStream.println.method) like you can do foo(PrintStream.class)?
Re:Java 9 with GPU processing, Java 10 will be all-OOP witho... by eternalban on Friday March 30, 2012 @08:36AM (#3775632)
No, a class's methods are not instances of java.lang.reflect.Method. The latter is simply a 'reflection', per the package name, of first class JVM construct e.g. a reflection on a method.
Re:Java 9 with GPU processing, Java 10 will be all-OOP witho... by riffraff on Friday March 30, 2012 @11:13AM (#3776305)
would you care to explain why this is not enough? You can pass them around, invoke them, get their properties.

The interface may be bad but I'm not sure what is missing.

Re:Java 9 with GPU processing, Java 10 will be all-OOP witho... by eternalban on Friday March 30, 2012 @01:35PM (#3777117)
In the original comment, I was merely addressing the misunderstanding of the GP regarding the reflection packages constructs.

The interface is your basic (irreducible) disconnected/unbound procedure invocation API, with all the positive/warts associated. I agree that in principle, we have enough information in the reflection data structure to allow a (specific) JVM implementation to provide a non-standard 'method object' feature. Consensus, possibly? (Good question, really. C. Nutter is one to hit with that one.)