We have updated C# XOM (csharpxom) to support C# 4.0 (in fact there are very few changes).
From the grammar perspective this includes:
Dynamic type, C#:
dynamic dyn = 1;
C# XOM:
<var name="dyn"> <type name="dynamic"/> <initialize> <int value="1"/> </initialize> </var>
Named and Optional Arguments, C#:
int Increment(int value, int increment = 1) { return value + increment; } void Test() { // Regular call. Increment(7, 1); // Call with named parameter. Increment(value: 7, increment: 1); // Call with default. Increment(7); }
<method name="Increment"> <returns> <type name="int"/> </returns> <parameters> <parameter name="value"> <type name="int"/> </parameter> <parameter name="increment"> <type name="int"/> <initialize> <int value="1"/> </initialize> </parameter> </parameters> <block> <return> <add> <var-ref name="value"/> <var-ref name="increment"/> </add> </return> </block> </method> <method name="Test"> <block> <expression> <comment>Regular call.</comment> <invoke> <method-ref name="Increment"/> <arguments> <int value="7"/> <int value="1"/> </arguments> </invoke> </expression> <expression> <comment>Call with named parameter.</comment> <invoke> <method-ref name="Increment"/> <arguments> <argument name="value"> <int value="7"/> </argument> <argument name="increment"> <int value="1"/> </argument> </arguments> </invoke> </expression> <expression> <comment>Call with default.</comment> <invoke> <method-ref name="Increment"/> <arguments> <int value="7"/> </arguments> </invoke> </expression> </block> </method>
Covariance and contravariance, C#:
public interface Variance<in T, out P, Q> { P X(T t); }
<interface access="public" name="Variance"> <type-parameters> <type-parameter name="T" variance="in"/> <type-parameter name="P" variance="out"/> <type-parameter name="Q"/> </type-parameters> <method name="X"> <returns> <type name="P"/> </returns> <parameters> <parameter name="t"> <type name="T"/> </parameter> </parameters> </method> </interface>
Other cosmetic fixes were also introduced into Java XOM (jxom), COBOL XOM (cobolxom), and into sql XOM (sqlxom).
The new version is found at languages-xom.zip.
See also: What's New in Visual C# 2010
Remember Me
a@href@title, b, blockquote@cite, em, i, strike, strong, sub, super, u