JEPs proposed to target JDK 9 (2015/1/15)
sundararajan.athijegannathan at oracle.com
Mon Jan 19 06:45:19 UTC 2015
If the NodeVisitor interface includes default implementation that calls
visitUnknown method, then your scheme could be implemented as
visitUnknown override (i.e., Class->lambda selection logic and
maintaining state etc).
Also, users can implement few selective visitABC methods - as the rest
have default implementation - which is one of the advantages your scheme
- selectively implement visit for only few types.
On Friday 16 January 2015 04:22 AM, Remi Forax wrote:
> On 01/15/2015 11:31 PM, mark.reinhold at oracle.com wrote:
>> 236: Parser API for Nashorn http://openjdk.java.net/jeps/236
>> Feedback on these proposals is more than welcome, as are reasoned
>> objections. If no such objections are raised by 23:00 UTC next
>> Thursday, 22 January, or if they're raised and then satisfactorily
>> answered, then per the JEP 2.0 process proposal  I'll target
>> these JEPs to JDK 9.
>> (This information is also available on the JDK 9 Project Page ).
>> - Mark
> for JEP 236, I'm not sure that we need a visitor anymore along with
> the AST, now that we have lambdas,
> a HashMap AST node -> function to execute, is enough.
> see for an example of usage
> and the definition of a Visitor
> Note: that this 'new visitor' doesn't need any support method (usually
> named 'accept') defined on the AST node.
More information about the nashorn-dev