DCSIMG
C# 3.0 Mono update - IHateSpaghetti {code}

IHateSpaghetti {code}

VSX, DSL and Beyond by Eyal Lantzman

Syndication

Coding / Architecture

Extensibility /DSL

Projects

Articles

C# 3.0 Mono update

Marek Safar announced that C# 3.0 compiler support for Implicitly typed local variables and implicitly typed arrays are fully supported.

Implicitly typed local variables

instead of:

int a = 10;
var a = 10; //a will be set baset on the value's type

or:

string[] arr = new string[]{.....};

foreach(var item in arr) {...} //the item is string

Implicitly typed arrays

var a1 = new[] {"a", null, "b" };
var a2 = new[] { -1, 0, 2.0 };
var a3 = new[,] { { "a" }, { "b" } };

array support is required specialy because of the support of anonymouse classes, widely used in LINQ (usualy represent some IEnumerable<T> anonymouse class or the expression based "evaluation/execution plan" that eventualy returns IEnumerable<T>).

Published Sunday, July 08, 2007 3:46 PM by Eyal
תגים:,

Comments

No Comments

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Enter the numbers above: