Using the ExpressionVisitor
As mentioned during our discussion about LINQ providers in Chapter 20, expression trees are particularly useful in scenarios where the user’s intent must be interpreted at runtime; for example, to translate query expressions. To achieve this, the compiler delivers on the homoiconicity property for lambda expressions so that users don’t have to write expression trees by hand.
The other stakeholder in this whole picture of runtime interpretation of expression trees is the library or application developer who wants to carry out this analysis of such an expression tree at runtime. Because of the deeply recursive nature of expression trees, this might seem like a frightening task. Luckily, however, it’s a task for which ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access