Odd query expressions
Yesterday, I was proof reading chapter 11 of the book (and chapter 12, and chapter 13 – it was a long night). Reading my own text about how query expressions work led me to wonder just how far I could push the compiler in terms of understanding completely bizarre query expressions. Background Query expressions in C# 3 work by translating them into “normal” C# first, then applying normal compilation. So, for instance, a query expression of: from x in words where x.Length > 5 select x.ToUpper() … is translated into this: words.Where(x => x.Length > 5) .Select(x => x.ToUpper()) Now, usually the source expression (words in this case) is something like a variable, … Continue reading Odd query expressions