Channel 9: Dynamic in C#

Not too long ago, I did another Channel 9 video on Dynamic in C# with another compiler dev, Chris Burrows. In this video, we discuss the making of dynamic, as well as some of the drawbacks, design decisions, and philosophies behind the feature. Enjoy! link:


Dynamic in C# VII: Phantom Method Semantics

By now, my hope is that you all have a well-rounded view of dynamic. We started this series by introducing dynamic and talking about the basics of the feature, and have just finished talking about some of the feature’s limitations with the intent that giving both the good and the bad will help us gain…


Dynamic in C# VI: What dynamic does NOT do

As I mentioned last time, there are a few gotchas that we’ll need to look at in order to get a full understanding of the dynamic feature and its capabilities. Today we’ll take a look at some of those limitations. As we go along, I’ll try to shed some insights as to how the decision…


Dynamic in C# V: Indexers, Operators, and More!

Now that we’re all experts in how dynamic invocations work for regular method calls, lets extrapolate from our previous discussion about phantom methods a bit and take a look at how those basic concepts apply to other dynamic operations. Today we’ll just go through a laundry list of each type of operation, and throw in…


Dynamic in C# IV: The Phantom Method

Yes, this does sound like a Star Wars movie, but no, I’m not a Star Wars geek that just likes to pull lines from my favorite movies (though I rather enjoyed Star Wars). This post will deal with what we’ve coined "the phantom method". It’s the method that the static compiler will bind to during…


Dynamic in C# III: A slight twist

Last time we dealt with the basics of dynamic binding. This time, we’ll add a small twist. First, lets recall the example we were using last time: static void Main(string[] args) { dynamic d = 10; C c = new C(); // (1) Dynamic receivers. d.Foo(); // Call. d.PropOrField = 10; // Property. d[10] =…


Dynamic in C# II: Basics

Last time, we began to dive into dynamic binding in C# and what happens through the pipeline. This time, we’ll take a simple scenario and pick apart the details of what happens under the covers, both during compile time and runtime. We can break down what the compiler does into three parts: type and member…


Dynamic in C#

The other day I was playing around with some office code, and I found myself writing a lot of code much like the following sample that Anders used at his PDC talk: static void Main(string[] args) { var xl = new Excel.Application(); ((Excel.Range)xl.Cells[1, 1]).Value2 = "Process Name"; ((Excel.Range)xl.Cells[1, 2]).Value2 = "Memory Usage"; } As you…