|
I'm not sure. I love closures.. but in Java I use annonymous classes for the same effect. So why do I need the new syntax (I understand that there are some differences).
However, I would prefer if I didn't have to declare an interface to do a closure.. that would make it very limited (I browsed through the proposal posted yesterday and that is what I remember).
I would just like to run:
Collection col = collection.collect(
(each) { transform(each) });
And the datatype of the closure would be Closure (or Block if you prefer) but there could be subclasses for 1, 2, 3, or variable args.
That brings me back to my original question.. isn't this just syntactic sugar for inner classes?
Java made mistakes because it was affraid of C#, now Ruby appears and we have to cave in to that new trend? What's next? Declarative Java? (O crap, they already added that.. annotations). |