Archive

Archive for June, 2009

Referential Identity and Internship

June 30, 2009 Leave a comment

I was thinking about a gotcha in Java, and started wondering about the idea of making it convenient to intern reference objects.
Read more…

Categories: .NET, C#, Interop, threads Tags: , , ,

Generic Value Object With Yield Return

June 9, 2009 3 comments

Inspired by this and this, here’s my version.

Jan Van Ryswyck is right to use static reflection, and to do that he "registers" the properties in a list. On the other hand, assuming you’d have a lot of these objects building up in the GC, it might prove important to reduce the number of ancillary allocations going on, so it may be better to avoid creating a list of the properties in every single instance.

Read more…

Lazy Sequence Generation without using Yield Return

June 4, 2009 4 comments

C# has the yield return feature, which makes it easy to write state machines as if they were plain old methods:

Read more…

Follow

Get every new post delivered to your Inbox.