Syntax...

Howard Lovatt howard.lovatt at iee.org
Mon Nov 23 03:16:27 PST 2009


I think that you need to be careful when adding to a language, the key
points are Clarity, Consistency, and Conciseness (in that order of
priority). These three 'C's constrain a good addition to the language and
can be used to compare competing proposals, i.e. if a proposal has more
clarity to the reader of the code it is better, if the clarity id roughly
the same then consistency with other language features is important, finally
if the other Cs are roughly equal then Conciseness comes into play. For
inner classes/closures/lambdas in Java the Cs translate into:

1. Use an unabbreviated keyword, I suggest method (see 2. - I am suggesting
inner classes, hence method) - this is both clearer and more consistent with
existing Java than other suggestions that use a symbol

2. Use an existing concept, i.e. Inner Classes (they are also more powerful
since they enclose both scopes) - this is consistent with the existing
language (don't introduce an overlapping concept)

3. Use existing interfaces, i.e. instead of function types (Lambda
conversion only to use a BGGA term) - be consistent with the existing
language (don't introduce an overlapping concept)

NB if you introduce a source statement then you can have a new normal
keyword, which would help any proposal a great deal

 -- Howard.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/closures-dev/attachments/20091123/cf54c0c6/attachment.html 


More information about the closures-dev mailing list