C#.Next, What do you expect?
I have been searching for any clue about the next version of C# and what the features to be included, and I finally found something on Charlie Calvert's blog.
The Dynamic Lookup, a.k.a Late Binding, this feature will be great in the interoperability between DLR languages and C#, COM interoperability, and also in the Reflection Scenarios.
This is how it suggested to look like, this syntax is not yet finalized.
static void Main(string[] args)
{ dynamic
{ object myDynamicObject = GetDynamicObject();
myDynamicObject.SomeMethod(); // call a method
myDynamicObject.someString = "value"; // Set a field
myDynamicObject[0] = 25; // Access an indexer
}
}
So this adds a new keyword to the language (dynamic) which is another scope where the compiler is not looking up for methods & properties in compile time, and the runtime will do this job.
This code can already be written today using reflection and searching for the right method and invoke it, this is much cleaner and the dynamic scope idea is nice as it fits well with the C# syntax scheme.
So by the time next version of C# ships, the C# language will have a very wide spectrum of programming models, starting from unsafe direct memory pointers to dynamic late binding.