C# 3.0 Features Without Visual Basic
9.0 Counterparts
C# 3.0 has some features that do not have an equivalent in
Visual Basic 9.0. These features are the yield keyword
and anonymous methods. Neither of these features is
fundamental to supporting LINQ, even if they are useful in many situations that
are common when writing code that uses LINQ.
The yield Keyword
Visual Basic 9.0 does not have a feature that corresponds to
the C# 2.0 yield keyword. You can implement iterators
in Visual Basic 9.0 by using an iterator design pattern. Remember that
yield does not require support from the CLR. It is implemented by the
compiler that generates the code necessary for implementing the iterator.
Anonymous Methods
Anonymous methods are not available in Visual Basic 9.0 as a
stand-alone feature, but sometimes lambda expressions can be used as a
substitute. Closures for lambda expressions are generated by the compiler in a
way that is similar to that used by the C# compiler with anonymous methods.
However, lambda expressions cannot replace anonymous delegates in every
situation.