Archive for January, 2009

Using Collection Initializers with Immutable Lists

January 29, 2009 Leave a comment

The Incomparable Mr Skeet mentions how irksome it is that collection initializers assume that the collection is mutable.

Suppose we defined an "immutable-yet-initializable collection" as any type that supports this interface

Read more…

Categories: C#, immutable Tags: ,

Linq to C++0x

January 26, 2009 4 comments

Updated 2011-10-31Major update based on boost range adaptors!!

C++ has long had some functional-styled things in its standard library, in particular a header file called <functional>. But actually using it in a functional way has been painful, largely due to the lack of lambdas.

But C++0x (very good Wikipedia page, by the way) solves this, amongst many other long-standing problems.

With lambdas in place, the next thing I naturally wonder is: what about a complete system of lazy-evaluated list processing, which is to say: what about Linq to Objects in C++?

Read more…

Categories: C#, lambdas, LINQ Tags: , ,