PROPOSAL: Method and Field Literals (original) (raw)
Howard Lovatt howard.lovatt at iee.org
Wed Mar 18 23:39:02 PDT 2009
- Previous message: Proposal: Embedded Expressions for String Statements
- Next message: PROPOSAL: Static Methods in Interfaces (v1.1)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
A couple of points:
This would be a nice addition to the language
Make it orthogonal so that you don't make Java harder to learn, i.e. use JavaDoc syntax, allow fields, methods, constructors, and classes.
Deprecate .class and replace with #class, Java shouldn't have new got'yas.
ArrayList#ArrayList() isn't a problem, it can mean constructor access in Java and the exotic identifier syntax can be used for non-Java names containing hash.
You don't have to solve all the problems on day one; we can come back and make the Field/Method literals better in future Java versions (also see next point), e.g. fix Field and Method to be generic.
If a source statement, see source and encoding proposal on coin, is added to Java then this proposal doesn't prevent future expansion of Java. In particular:
A. If a new inner-class/closure/method-reference syntax is added
to Java then it can use a keyword instead of having to reuse #, JavaFX for example uses function.
B. A new keyword can be used for MethodHandels.
C. A new keyword can be used for reflective property access
- Previous message: Proposal: Embedded Expressions for String Statements
- Next message: PROPOSAL: Static Methods in Interfaces (v1.1)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]