O'Reilly logo

C# 5.0 Unleashed by Bart De Smet

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Dynamic Call Sites and Binders

Closest to the user-written code is the call site that represents a dynamic operation. For instance, if the following code is written, two call sites result:

static void Add(dynamic a, dynamic b){    Console.WriteLine(a + b);}

Why two? Because a and b are declared as dynamic, it’s obvious that a + b is a dynamic operation. Multiple invocations of this method, with different arguments, can result in the use of different + operators, defined for different types. The + operation requires a first call site, as explained later.

So, where’s the second call site? Because a + b is a dynamic operation, its result is also typed as dynamic. This is the result of the contagious property of dynamic ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required