Ired Sedl
Posts: 2
Nickname: ired
Registered: Dec, 2006
|
|
Re: Considering Closures for Java
|
Posted: Dec 27, 2006 12:20 PM
|
|
My great hope is that folks responsible for the future of Java restrain themselves from adding unnecessary and cumbersome symbols. (i.e., '=>' and things of that nature)
Why can't we just rewrite the closure as such:
{ (int x, int y) x + y }
or
{ int x, int y { x + y } }
or better yet, why not simply simulate the traditional method call, thereby underscoring the fact that closure is essentially a nested method, thus its parameter declaration and scoping should resemble the familiar method syntax.
(int x, int y) { x + y }
Why introduce all these new symbols? Java is a clean language, adding two-character symbols for something which can be easily expressed using parenthesis or braces is not buying any "character savings", and does not facilitate familiarity for newcomers.
Whats with the symbol love?
{ int x, int y => x + y }
In my opinion, its not clean. If one were to use the colon, it might be better, but then again, why not just use the tried and true method declaration syntax?
I've posted this to Neil Gafter's blog, but apparently either the moderation system malfunctioned, or this proposal didn't pass the censor.
|
|