by admin
30. April 2004 09:41
OK, the first step of Rikxtensible C# has been done. Ever wanted to print "Hello World" via an attribute? This fragment now compiles, and after running through Rikxtensible C# allows the PrivateImportAttribute to provide the code for TestMethod.
class TestClass
{
[PrivateImport(), MethodImpl(MethodImplOptions.ForwardRef)]
static extern void TestMethod();
[STAThread]
static void Main(string[] args)
{
TestMethod();
}
}
Obviously, this is only a proof of concept at the moment but soon we'll have compile time code injection for C#.
fe2e7ca4-ff51-4f31-88cc-eec34a761f8a|0|.0
Category: Programming
Tags: