PROPOSAL: Method and Field Literals
schulz at e-Spirit.de
Wed Mar 11 00:54:28 PDT 2009
Surprisingly, I wholeheartly support this proposal (not that it would matter to anyone ;)).
A question and a remark:
1. In the original idea, you said it would be great to support chained references. Wonder, if this could be somehow done. Especially, if using references for properties, having some A#foo#bar resolving to typeOfField(A#foo)#bar would be nice. As for the compiler (not knowing too much of it), wouldn't this only require some one-token-lookahead to not turn A#foo into the corresponding Field but to fetch it's type?
2. For Field, parameterization seems simple, although one could think of a subtype or wrapper of a Field being returned by a literal. Except for its return type, I cannot see a simple solution for Method, though, without employing some method or function type (which clearly is out of scope for coin).
P.S.: You could have cited FCM btw. for some examples etc., as it is quite identical. It also contains the constructor stuff, which would be an intersting addition only, if one could pass it around. Otherwise, one would need to reference the concrete class for a constructor anyway.
> -----Original Message-----
> From: coin-dev-bounces at openjdk.java.net
> [mailto:coin-dev-bounces at openjdk.java.net] On Behalf Of Jesse Wilson
> Sent: Wednesday, March 11, 2009 3:50 AM
> To: coin-dev at openjdk.java.net
> Subject: PROPOSAL: Method and Field Literals
More information about the coin-dev