CSharpFeeds - All your C# feeds in one place.

Thursday, December 06, 2007

Immutability in C# Part Three: A Covariant Immutable Stack

by Eric Lippert via Fabulous Adventures In Coding on 12/6/2007 3:55:00 PM

Now suppose we had a hypothetical future version of C# in which interface covariance worked, and we wanted a covariant immutable stack. That is, we want to be able to implicitly convert an IStack<Giraffe> to IStack<Mammal>. As we've already discussed, this doesn't make much sense in an array, even though doing so is legal in C# today. If you cast a Giraffe[] to Mammal[] then you can try to put a Tiger into the Mammal[] and it will fail at run time. It seems like the same should be t ...

[ read more ]

C# Trivia #6

by jokiz via jokiz : C# on 12/6/2007 2:43:00 AM

As I've mention in this post, I'll be continuing the trivia series here in my blog.  I've encountered a good one from internal chat yesterday, here it is: will this compile? [Test] public void IntTests() {     int i = 1;     if(i != null)     {         Debug.Write("jokiz");     } } ...

[ read more ]

Understanding Interfaces in C#

by Brendan Enrick via ASPAlliance.com - Articles, reviews, and samples for .NET Developers on 12/6/2007 12:00:00 AM

Interfaces are a very useful tool built into C#. In this article Brendan explains the basics of how interfaces work and for what they may be used. He explains how to create simple custom interfaces and how to implement them. ...

[ read more ]

Subscribe

New Feed

Product Spotlight

Recently Updated Sources

Legal Note

The content of the postings is owned by the respective author. CSharpFeeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on CSharpFeeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.

Advertise with us