Geeks With Blogs

Neat Stuff Read all my hurricane entries While you are here, visit the Geeks With Blogs main feed
Links Status of the Navy
Channel 9

.NET Hobbyist Programmer Staying Confused in a Busy World

Some neat stuff coming.  From the summary of the C# 3.0 Overview.  Most of these revolve around lambda and query expressions.

Update: What to read a really bizarre explanation of the "red and green model" for compatibility in .NET 3.0?  Check out Somasegar's strange backflips about promising binary compatibility without really promising it.  I agree with the first two commenters to that post: do not try for compatibility, but rather work towards building the very best framework possible.  Perhaps Hejlsberg has lost his way also?

C# 3.0 ("C# Orcas") introduces several language extensions that build on C# 2.0 to support the creation and use of higher order, functional style class libraries. The extensions enable construction of compositional APIs that have equal expressive power of query languages in domains such as relational databases and XML. The extensions include:

  • Implicitly typed local variables, which permit the type of local variables to be inferred from the expressions used to initialize them.
  • Extension methods, which make it possible to extend existing types and constructed types with additional methods.
  • Lambda expressions, an evolution of anonymous methods that provides improved type inference and conversions to both delegate types and expression trees.
  • Object initializers, which ease construction and initialization of objects. (see article here)
  • Anonymous types, which are tuple types automatically inferred and created from object initializers.
  • Implicitly typed arrays, a form of array creation and initialization that infers the element type of the array from an array initializer.
  • Query expressions, which provide a language integrated syntax for queries that is similar to relational and hierarchical query languages such as SQL and XQuery.
  • Expression trees, which permit lambda expressions to be represented as data (expression trees) instead of as code (delegates).

This document is a technical overview of those features. The document makes reference to the C# Language Specification 1.2 (§1 through §18) and the C# Language Specification 2.0 (§19 through §25), both of which are available on the C# Language Home Page.

Posted on Friday, May 19, 2006 4:14 PM Programming | Back to top

Comments on this post: C# 3.0 (Orcas)

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Mark Treadwell | Powered by: