Previous questions asked if delegates could be compiled into expression trees, for example:
- Convert .net Func <T> to .net Expression expression <Func β>
There were sensible answers at that time:
- It is possible, but very difficult and there is no standard library solution.
- Use a reflector!
But, fortunately, there are some very crazy / crazy great people who love reverse engineering and they make difficult things easy for all of us.
Clearly, you can decompile IL in C #, as Reflector does, and so you could instead orient CLR 4.0 expression trees with support for all types of statements. This is interesting because it doesnβt matter if the built-in special compiler support for Expression<> lambdas never expands to support expression expression trees in the compiler. A library solution can fill a gap. Then we would have a high-level starting point for writing aspect-like code manipulations without having to mess with raw ILs.
As noted in the answers to the above related question, there are some promising signs , but I have not been able to find if there has been much progress after the search.
So, did anyone finish this job or get it very far?
Note. CLR 4.0 is now released. Time for a different look - look.
Daniel Earwicker
source share