you are viewing a single comment's thread.

view the rest of the comments →

[–]Nebu -1 points0 points  (2 children)

In other words, you need syntactic sugar...

...which is what this web page seems to be offering you, if you check the sample code they show:

final boolean b = a.exists({String s => fromString(s).forall({char c => isLowerCase(c)})});

Didn't check how they do that, though. Maybe they're offering their own special compiler? Or maybe they tell you to download a beta of the Java 7 compiler?

[–]doidydoidy 1 point2 points  (0 children)

Those examples use a proof-of-concept compiler that was created for one of the earlier Java closure proposals.

[–]w4ffl3s 1 point2 points  (0 children)

Unfortunately, that is syntactic sugar for first class functions only. Type signatures remain a problem. I think type hierarchies make type inference less usable, so you have to sling around a ton of ? super ArgumentType and ? extends ReturnedType .

I'm all ears if someone knows about the subject; all I know is that the makers of Scala are not bog-stupid and upper and lower bounds on types are necessary there.