In fact, there is currently no way to do this.
We understand that in C # 3 we created some philosophical oxymoron. The LINQ design is heavily imbued with the traditional, unchanging functional programming style β execution is delayed, queries are represented by immutable monads, expression trees are immutable, and so on.
Yet at the same time, object initializers, collection initializers, and autoresists encourage a traditional programming style based on mutable components. It seems that we are moving in both directions, which indicates the nature of C #; it is a pragmatic programming language that supports many different programming styles.
However, since we are all big fans of the immutable programming style, and since we believe that this style will pay dividends to simplify the correctness of multi-threaded applications in future ubiquitous multi-core architectures, it is definitely interested in somehow taming the variability that we introduced . Only repetitive auto programs are one obvious way to do this; small step, but good.
That is all said, we have not yet sent C # 4, and have not announced that after this new language functions will appear. You should consider all my reflections on the hypothetical features of unannounced products as βfor entertainment purposes onlyβ and not as promises or announcements.
Eric Lippert Oct 08 '09 at 14:52 2009-10-08 14:52
source share