I just took a look at the Expressions grammar for D 2.0 (NewExpression) and something caught my attention:
NewExpression:
NewArguments ClassArguments BaseClasslistopt { DeclDefs }ClassArguments:
class ( ArgumentList ) class ( ) class
What exactly are these ClassArguments and DeclDefs? Is there an example somewhere that demonstrates their use?
ClassArguments is the keyword
classfollowed by the constructor arguments. DeclDefs are the declarations inside the class.This syntax is to create an instance of an anonymous nested class, e.g.
(See http://ideone.com/cA1qo.)
The above can be rewritten into the less obscure form