.NET expression trees can be used to write self-modifying compiled programs -- because it is possible to construct and compile a method at runtime, it is also possible for a method to rewrite its own code at runtime.
.NET leverages this for dynamic typing in C#, taking advantage of the fact that even for dynamically-typed code, the vast majority of usages at a given call site will have the same types. Each dynamic call site has a corresponding expression tree, and a corresponding method. Every time a new set of types is encountered at this call site, additional logic which handles the new types will be added to the expression tree, which is then compiled into a new method; this new method becomes the method corresponding to this call site.
Aside from the fact that I haven't been able to see this mechanism running live, I feel it's too complex and distracting from the simplicity of the primary concept.
What relatively simple use case could I use to demonstrate the value of this property, of allowing the writing of a self-modifying program? Is there a standard example?