• Chaur Wu


Metaprogramming is everywhere in the DLR. All the LINQ Expression examples you saw in Chapter 2 and all the DLR Hosting API examples you saw in Chapter 6 are metaprograms. Because metaprogramming plays such a pervasive role in the DLR, we’re going to dive deeper into the subject and show you some advanced and marvelous uses of metaprogramming. We will begin with an overview of metaprogramming. The overview will discuss what metaprogramming is and where it is used in the DLR, then we’ll look at one type of metaprogramming that adds and removes methods or properties to or from a class or an instance of a class. We will illustrate the metaprogramming technique in Ruby and Python, then write some infrastructure code that enables us to use the same kind of metaprogramming technique in C# through the DLR. The infrastructure code will consist of two classes called ClassMetaObject and ExpandoClass.


Expression Tree Instance Level Customer Class Dynamic Language Lambda Expression 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Chaur Wu 2010

Authors and Affiliations

  • Chaur Wu

There are no affiliations available

Personalised recommendations