I am currently working on a project where I want to decouple command processing from command invocation. This is usually done using something like the Command pattern, however that pattern does not lend itself to functional composition of commands. What I wanted was something more akin to the processing model in the Emacs editor.
Well, LINQ has been around for a while now and I suppose many of you have been playing with (I mean using) it in both production and hobby code. One of the core features that LINQ requires is the ability to express lambda expressions as expression trees rather than delegates. Delegates represent compiled (and thus opaque) code, but expression trees can be manipulated for optimisation and language translation, such as to SQL.
Now LINQ does that all for you, but have you ever wondered whether you can make an expression tree directly?