This was a popular session, so I went a bit early to get a good seat.
Of course, lots of people want to here what Anders Hejlsberg had to say about C# 4.0
He showed the evolution of C# in time :
And then showed the new language innovations of C# 4.0:
There will be a DLR capable of using a vast set of binders :
Now, when you have to dynamically invoke a method at run-time, you have to do all sorts of nasty code which can be different for each target (C# object, Javascript object).
The new dynamic keyword, statically types a variable to be dynamic. This way, the DLR will kick in, and do dynamic method invocation and convert the result dynamically.
Some more examples:
If you dynamically type the result of a Math.Abs call, the DLR will choose the correct overload at run time
Another new feature in C# 4.0 is named and optional parameters:
AND improved COM interop:
(No more Missings..)
AND some changes in Co- contra variance of generics:
Anders concluded his talk, with a glimpse of the future. He’s showed a preview of a managed c# compiler which should allow Meta data programming, a language model, DSL embedding and dynamic eval of code:
He gave a funny demo of this with a self-written C# command line tool which evaluates code and runs it :
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5