How Does All of This Relate to C# Programming?
Notice how traditionally statically typed programming languages like C# can also take advantage of the DLR infrastructure to reach out to the world of dynamic typing where appropriate. This is precisely what the C# 4.0 dynamic feature is about, which we get into later in this chapter, as well as in the next chapter.
When writing code as shown in the following fragment, one defers the discovery of the member used in the method call until runtime. It should be said that this shouldn’t be regarded as a substitute for static typing, but when no static type information is within reach, the use of dynamic makes code much more readable than it would have been if you had to do all the member discovery and ...
Get C# 5.0 Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.