I need to follow my heart

不要让任何人的意见淹没了你内在的心声
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

C# 3.0预览(1)

Posted on 2006-07-25 14:27  野娃  阅读(360)  评论(1编辑  收藏  举报

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:(C# 3.0C# Orcas——魔鬼)在C# 2.0的基础上引入了很多语言扩展,用以支持高级别的函数式风格类库的创建和使用。这些扩展使得结构性API构造具有与其他领域(如关系数据库和XML)中查询语言同等的表达能力。这些扩展包括:)

·         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.(拉姆达(Lambda)表达式,匿名方法的一种进化,为委托类型和表达式树提供了改进的类型推断和转换。)

·         Object initializers, which ease construction and initialization of objects.(对象初始化器,使得构造和初始化对象变得容易。)

·         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.(查询表达式,提供了集成的查询语法,与关系、分级查询语言如SQLXQuery类似。)

·         Expression trees, which permit lambda expressions to be represented as data (expression trees) instead of as code (delegates).(表达式树,允许将拉姆达表达式表现为数据(表达式树),而不是代码(委托)。)