While .NET 2.0 fx (including C# 2.0) is still in it’s beta’s, some developers (including me) won’t get excited anymore by talk about generics, the yield statement, partial classes, etc….
Something that did is Cw (or Comega language).
Cw is a programming language, based on C# 2.0 that includes 4 language extensions from what I believe once were separate research projects at Microsoft. These language extensions are:
- Xml language support
- Sql language support
- Tuple support
- Concurrency support
All extensions are bundled into 1 compiler (which is still a preview version) and can be downloaded here. Read the language documentation over here. The compiler integrates with VS.NET 2003 and comes with sample source code.
A brief example of xml integration in c# sourcecode:
//returns the contents for a html table that
//displays x & y coordinates
tr* GeneratTableRows(Point[] collectionOfPoints)
{
//yield the header for the html table
yield <tr>
<th>X Coordinate</th>
<th>Y Coordinate</th>
</tr>;
//for each Point in the given array, return a single row.
//!!note that the contents of '<td>' is typesafe, therefore .ToString() should
//be used. Anything else will result in compiler errors (and ‘editor squirlies’
foreach(Point p in collectionOfPoints)
{
yield <tr>
<td>{p.X.ToString()}</td>
<td>{p.Y.ToString()}</td>
</tr>;
}
}
//in a referenced class the xml format is defined
//possibly generated using xsd2comega.exe!
//tr contains multiple th's or td's
//tr contains 1 atribute style, typed as a string.
public class tr {
choice {
th;
td;
}*;
attribute string style;
}
//td is a block
public class td : block {}
//td is a block
public class th : block {}
//block contains multiple instances of either a, ..., block or string
public abstract class block {
choice {
a ;
//...//
block;
string;
}*;
}
A list of tools to support Cw development (cwc.exe, xsd2comega.exe, sql2comega.exe) can be found here.