Type Inference and IEnumerable

This is somewhat of a follow up on a previous post I did on the difference between IEnumerable(Of T) and the IEnumerable interfaces.  I’ve seen several people type in the following code and wonder if there was a fundamental bug in the type inference code. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)…


VS2008 Ships

Orcas has shipped 🙂 http://msdn2.microsoft.com/en-us/vstudio/default.aspx


Lambda Unexpected Behavior

One item you strive to avoid when you design and implement a feature is unexpected behavior.  Unfortunately there is one case we couldn’t avoid with Lambda’s in VB9.  I just ran into the this problem when coding up a handler.  I wanted to disable a button when the text of particular TextBox was empty.  I…


Extension Methods without 3.5 Framework

For a time I’ve been avoiding extension methods.  Not because I’m opposed to using them but because of the 3.5 Framework.  A lot of the tools I own are designed to be very light weight tools that only require the user to have 2.0 installed on their machine.  I find that the easier that tools…


Singleton Pattern

Quite awhile back I posted about how to create a re-usable singleton pattern in .Net.  Link is here.  A bit of time has passed and I’ve altered the pattern a bit.  The reasons for the change are some new type inference patterns and FxCop cleanliness.  The first pattern I introduced had a couple of FxCop…


C# Type inference change for Orcas

While playing around with a batch of Orcas code recently I found a welcome change to the C# type inference rules for Orcas.  The return type of a generic delegate can now be inferred from the actual return values.  Here is some sample code demonstrating the problem.  class Program { public delegate T Operation<T>(); public…


Closures in VB Part 6: Limitations

For previous articles in this series please see … Part 1: Introduction Part 2: Method Calls Part 3: Scope Part 4: Variable Lifetime Part 5: Looping As powerful as closures are in the language they do have a few limitations.  We worked hard in Orcas to put as few limitations in Orcas as possible.  Below…


Expression Evaluator Sample Released

The new version of the Visual Studio 2008 Beta2 SDK was just released.  Among the many new samples is a basic expression evaluator sample.  This sample shows you how to add basic debugger support to a managed language in Visual Studio.  This is the first version of the sample and mainly has support for locals…


Coding Quiz: Anonymous Type Types

Question: How can you create a variable in VB which is typed as an anonymous type but not actually create an instance of that type? Answer in comments.  Note, doing this is not particularly useful it came about while I was playing around with a feature a few days ago.


Closures in VB Part 5: Looping

For previous articles in the series please see Part 1: Introduction Part 2: Method Calls Part 3: Scope Part 4: Variable Lifetime Once again sorry for the long delay between posts.  Looping structures can cause unintended consequences when used with Lambda expressions.  The problem occurs because lambda expressions do not execute when they are constructed…