呵呵,这是基于PDC 2005 发布的C#3.0规范进行的翻译,因为很匆忙,所以就把英文一起贴出来,这样便于英文好的朋友指正。
我会持续在cp612sh.cnblogs.com上发布接下来的翻译内容,有兴趣的朋友可以到MSDN自行下载LINQ的相关资源,因为已经有了相应C#3.0的编译器,也就是说,你可以自己弄一个在VS2005上跑跑,做些试验,写点代码。
祝愿大家编程愉快。
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.0(“C# Orcas”)引入了一些语言的扩展,这些扩展是基于C#2.0做出的,并且支持到创新和更高端的命令,功能性风格的类库。这些扩展使得对于结构性的API的解释变得有效,并且使得C#能够像查询语言在某些领域(例如 关系型数据库和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.
· 匿名类型,它从tuple 类型自动被推断并且由对象构造者生成的。
· 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.
· 查询表达式,提供了一种语言内置的查询句法,有点类似关系型和等级型查询语言,例如SQL和Xquery。
· Expression trees, which permit lambda expressions to be represented as data (expression trees) instead of as code (delegates).
· 表达式树,允许lambda表达式被表示为数据(表达式树)以替代被表示为代码(代理)。
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 (http://msdn.microsoft.com/vcsharp/language).
本文是对于上述特征的一些技术概观。文档引用了C# Language Specification 1.2($1到$18)以及the C# Language Specification 2.0 (§19 到§25),这些都可以在C# Language Home Page (http://msdn.microsoft.com/vcsharp/language)上得到。