ImageVerifierCode 换一换
格式:PDF , 页数:70 ,大小:511KB ,
资源ID:1257425      下载积分:10000 积分
快捷下载
登录下载
邮箱/手机:
温馨提示:
如需开发票,请勿充值!快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝扫码支付 微信扫码支付   
注意:如需开发票,请勿充值!
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【http://www.mydoc123.com/d-1257425.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(ISO IEC TR 25438-2006 Information technology - Common Language Infrastructure (CLI) - Technical Report Common Generics《信息技术 通用语言结构(CLI) 技术报告 普通遗传学》.pdf)为本站会员(livefirmly316)主动上传,麦多课文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知麦多课文库(发送邮件至master@mydoc123.com或直接QQ联系客服),我们立即给予删除!

ISO IEC TR 25438-2006 Information technology - Common Language Infrastructure (CLI) - Technical Report Common Generics《信息技术 通用语言结构(CLI) 技术报告 普通遗传学》.pdf

1、 Reference number ISO/IEC TR 25438:2006(E) ISO/IEC 2006TECHNICAL REPORT ISO/IEC TR 25438 First edition 2006-08-01 Information technology Common Language Infrastructure (CLI) Technical Report: Common Generics Technologies de linformation Infrastructure commune de langage (ICL) Rapport technique: Gnri

2、ques communs ISO/IEC TR 25438:2006(E) PDF disclaimer This PDF file may contain embedded typefaces. In accordance with Adobes licensing policy, this file may be printed or viewed but shall not be edited unless the typefaces which are embedded are licensed to and installed on the computer performing t

3、he editing. In downloading this file, parties accept therein the responsibility of not infringing Adobes licensing policy. The ISO Central Secretariat accepts no liability in this area. Adobe is a trademark of Adobe Systems Incorporated. Details of the software products used to create this PDF file

4、can be found in the General Info relative to the file; the PDF-creation parameters were optimized for printing. Every care has been taken to ensure that the file is suitable for use by ISO member bodies. In the unlikely event that a problem relating to it is found, please inform the Central Secretar

5、iat at the address given below. ISO/IEC 2006 All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying and microfilm, without permission in writing from either ISO at the ad

6、dress below or ISOs member body in the country of the requester. ISO copyright office Case postale 56 CH-1211 Geneva 20 Tel. + 41 22 749 01 11 Fax + 41 22 749 09 47 E-mail copyrightiso.org Web www.iso.org Published in Switzerland ii ISO/IEC 2006 All rights reservedISO/IEC TR 25438:2006(E) ISO/IEC 20

7、06 All rights reserved iii Contents Page Foreword. v Introduction . vi 1 Scope . 1 2 Rationale 1 2.1 Reference vs. value tuples. 1 2.2 Interaction with other standard types. 2 3 Overview 2 3.1 Tuple types 2 3.2 Function and procedure types 2 3.3 Unit . 2 3.4 Optional . 3 3.5 Either 3 4 Action delega

8、tes . 3 4.1 System.Action delegate . 3 4.2 System.Action delegate 4 4.3 System.Action delegate . 5 4.4 System.Action delegate. 6 4.5 System.Action delegate 8 5 System.DelegateCast class . 9 5.1 DelegateCast.ToFunction(System.Predicate) method. 10 5.2 DelegateCast.ToPredicate(System.Function) method.

9、 10 5.3 DelegateCast.ToFunction(System.Converter) method. 11 5.4 DelegateCast.ToConverter(System.Function) method. 12 5.5 DelegateCast.ToFunction(System.Comparison) method . 12 5.6 DelegateCast.ToComparison(System.Function) method . 13 6 System.Either Structure . 13 6.1 Either.Equals(System.Object)

10、method 15 6.2 Either.Equals(Either) method . 16 6.3 Either.First property 17 6.4 Either.GetHashCode() method.17 6.5 Either.IsFirst property. 18 6.6 Either.IsSecond property 19 6.7 Either.op_Equality(Either, Either) method. 19 6.8 Either.op_Inequality(Either, Either) method 20 6.9 Either.Second prope

11、rty. 21 6.10 Either.MakeFirst(A aValue) method. 22 6.11 Either.MakeSecond(B bValue) method . 22 6.12 Either.ToString() method 23 6.13 Either(A) constructor 23 6.14 Either(B) constructor 24 6.15 A Either.op_Explicit(System.Either) method 25 6.16 B Either.op_Explicit(System.Either) method 26 6.17 Eith

12、er.op_Implicit(A) method . 27 6.18 Either.op_Implicit(B) method . 28 7 Function Delegates. 29 7.1 System.Function delegate . 29 7.2 System.Function delegate 30 7.3 System.Function delegate . 31 ISO/IEC TR 25438:2006(E) iv ISO/IEC 2006 All rights reserved7.4 System.Function delegate. 32 7.5 System.Fu

13、nction delegate 33 7.6 System.Function delegate 35 8 System.Optional structure. 36 8.1 Optional(T) constructor 38 8.2 Optional.CompareTo(System.Object) method. 38 8.3 Optional.CompareTo(Optional) method. 40 8.4 Optional.Equals(System.Object) method. 41 8.5 Optional.Equals(Optional) method. 42 8.6 Op

14、tional.FromNullable(Nullable) method. 43 8.7 Optional.FromOptional(System.Optional) method . 44 8.8 Optional.GetHashCode() method45 8.9 Optional.GetValueOrDefault() method 45 8.10 Optional.GetValueOrDefault(T) method . 46 8.11 Optional.HasValue property 46 8.12 Optional.op_Equality(Optional, Optiona

15、l) method. 47 8.13 Optional.op_Explicit(System.Optional) method . 48 8.14 Optional.op_Implicit(T) method 49 8.15 Optional.op_Inequality(Optional, Optional) method 50 8.16 Optional.ToNullable(Optional) method. 51 8.17 Optional.ToOptional(T) method 51 8.18 Optional.ToString() method. 52 8.19 Optional.

16、Value property. 53 8.20 Optional.INullableValue.Value property . 53 9 Tuple structures System.Tuple System.Tuple. 54 9.1 Tuple() constructors. 56 9.2 Tuple.Equals(System.Object) method 56 9.3 Tuple.Equals(Tuple) method. 57 9.4 Tuple.ItemA, Tuple.ItemB, Tuple.ItemJ field 58 9.5 Tuple.GetHashCode() me

17、thod. 58 9.6 Tuple.op_Equality(Tuple, Tuple) method 59 9.7 Tuple.op_Implicit(KeyValuePair) method 60 9.8 Tuple.op_Implicit(Tuple) method 60 9.9 Tuple.op_Inequality(Tuple, Tuple) method . 61 9.10 Tuple.ToString() method 62 10 System.Unit enum. 62 10.1 Unit.Unit field. 63 ISO/IEC TR 25438:2006(E) ISO/

18、IEC 2006 All rights reserved v Foreword ISO (the International Organization for Standardization) and IEC (the International Electrotechnical Commission) form the specialized system for worldwide standardization. National bodies that are members of ISO or IEC participate in the development of Interna

19、tional Standards through technical committees established by the respective organization to deal with particular fields of technical activity. ISO and IEC technical committees collaborate in fields of mutual interest. Other international organizations, governmental and non-governmental, in liaison w

20、ith ISO and IEC, also take part in the work. In the field of information technology, ISO and IEC have established a joint technical committee, ISO/IEC JTC 1. International Standards are drafted in accordance with the rules given in the ISO/IEC Directives, Part 2. The main task of the joint technical

21、 committee is to prepare International Standards. Draft International Standards adopted by the joint technical committee are circulated to national bodies for voting. Publication as an International Standard requires approval by at least 75 % of the national bodies casting a vote. In exceptional cir

22、cumstances, the joint technical committee may propose the publication of a Technical Report of one of the following types: type 1, when the required support cannot be obtained for the publication of an International Standard, despite repeated efforts; type 2, when the subject is still under technica

23、l development or where for any other reason there is the future but not immediate possibility of an agreement on an International Standard; type 3, when the joint technical committee has collected data of a different kind from that which is normally published as an International Standard (“state of

24、the art”, for example). Technical Reports of types 1 and 2 are subject to review within three years of publication, to decide whether they can be transformed into International Standards. Technical Reports of type 3 do not necessarily have to be reviewed until the data they provide are considered to

25、 be no longer valid or useful. Attention is drawn to the possibility that some of the elements of this document may be the subject of patent rights. ISO and IEC shall not be held responsible for identifying any or all such patent rights. ISO/IEC TR 25438 was prepared by Ecma International (as Ecma T

26、R/89) and was adopted, under a special “fast-track procedure”, by Joint Technical Committee ISO/IEC JTC 1, Information technology, in parallel with its approval by national bodies of ISO and IEC. ISO/IEC TR 25438:2006(E) vi ISO/IEC 2006 All rights reservedIntroduction This Technical Report defines a

27、 collection of types that are intended to enhance the common language nature of the CLI, by facilitating language inter-operation. The collection includes generic tuples, functions, actions, optional value representation, a type that can contain a value of one of two different types, and a utility f

28、iller type. These types are experimental and will be considered for inclusion in a future version of the CLI International Standard. A reference implementation, written in C#, is included (see the accompanying file CommonGenericsLibrary.cs). This implementation source is also available from http:/.n

29、z/ecma. A binary version is also available from that site, along with any updates to the proposal. Feedback on these types is encouraged. (Please send comments to .nz.) TECHNICAL REPORT ISO/IEC TR 25438:2006(E ISO/IEC 2006 All rights reserved 1 Information technology Common Language Infrastructure (

30、CLI) Technical Report: Common Generics 1 Scope The CLI standard libraries (ISO/IEC 23271) provide a collection of common types that can be used by multiple languages. With the addition of generics to the CLI, the standard libraries have been extended to include a number of common generic types, in p

31、articular, collections. However, at present, these libraries do not include many simple generic types found in a number of different languages. Any language which uses these common types must implement them rather than deferring to the CLI library, thereby reducing language inter- operability. This

32、Technical Report addresses this issue by providing a number of these common types. Generic tuples (product types) are standard in a number of languages: C+ (template Pair), Ada, Haskell, and Standard ML (SML). However, languages differ in the number of pre-defined tuple sizes supported by their stan

33、dard libraries; e.g. C+ provides just one (Pair) while Haskell provides eight (sizes 2 to 9) and SML allows any size of tuple. This Technical Report provides nine (sizes 2 to 10). Generic programming encourages “higher order” programming where generic functions (methods) take function (delegate) typ

34、e arguments that have generic types. Examples include Adas with and generic constraints, and function arguments in Haskell and SML. In the CLI, function values are provided in the form of delegates, so this proposal defines standard generic delegate types for functions (which return a value) and pro

35、cedures (which do not). Another two types that occur in a number of languages are an optional type, which either contains a value of some other type or an indication that such a value is not present; and an either type, which holds a value of one of two possible types and an indication of which one

36、is present. This proposal provides both of these. Note The optional type is similar to, but different from, the type System.Nullable. Finally, in existing generic languages, a need has been found for a filler type to be used when a particular generic parameter is not required for a particular use of

37、 the generic type. A standard one-value type is often provided for this purpose, often called Unit or Void. This Technical Report includes such a type. 2 Rationale 2.1 Reference vs. value tuples In some languages (such as C+ and Ada) tuple types can be value or reference types, while in others (such

38、 as Haskell and SML) they are always reference types. This implementation provides only value type tuples (which can contain value or reference types). Boxed versions of these types can be used when reference versions are required. Named boxed types would, of course, help greatly here, but these are

39、 not currently provided by the CLI Standard. A simple generic type, such as Boxed, can be written to address this issue. Such a type has been made available in the reference implementation of this proposal. However it is not being considered for standardization at this time. ISO/IEC TR 25438:2006(E)

40、 2 ISO/IEC 2006 All rights reserved2.2 Interaction with other standard types The CLI Standard contains six types related to those in this proposal. These are: System.Action: This type is just the first member of this collections set of action types. As it is already standardized it is not included h

41、ere. System.Comparison: This type is equivalent to this collections Function. Conversion methods are provided. System.Converter: This type is equivalent to this collections Function. Conversion methods are provided. System.Nullable: This type is a restricted version of this collections Optional. The

42、 difference is that Nullable is restricted to non-nullable value types, whereas Optional can also wrap reference types and nullable value types. Both these choices are useful in different applications, so there is no clash between these two types. This proposal includes operators on the Optional typ

43、e to convert to/from Nullable values. System.Predicate: This type is equivalent to this collections Function. However as the CLI does not support type synonyms, these two types are (unfortunately) not equivalent. A separate static class provides methods to convert between these two types. The method

44、s are in a separate class as additional methods cannot be declared on delegate types. System.Collections.Generic.KeyValuePair: This is just a differently named equivalent of this collections Tuple. Conversion operators are provided on Tuple to convert to/from KeyValuePair. 3 Overview 3.1 Tuple types

45、 Tuples are provided as value types with public fields, which mirrors their typical usage in current languages. Overloading on arity is leveraged to provide eight standard tuple types. The fields are named ItemA, ItemB, , ItemI. A single n-ary constructor is provided to easily define all fields. An

46、Equals() method is provided and defined as the component fields being equal according to their Equals() methods. The corresponding GetHashCode() method and op_Equality and op_Inequality methods are provided. ToString() is overridden to provide the typical tuple parenthesized notation. For tuples of

47、size 2, methods are provided to convert to/from values of type System.Collections.Generic.KeyValuePair. 3.2 Function and procedure types Standard delegates are provided for function types (System.Function). Delegates are defined for 0 to 5 argument functions and 0 and 2 to 5 argument procedures. (Th

48、e single argument procedure is already included in the CLI Standard.) 3.3 Unit The Unit type is a filler type. This is useful, for example, when an existing generic type is used, but one of its type arguments is not required for the particular application. ISO/IEC TR 25438:2006(E) ISO/IEC 2006 All r

49、ights reserved 3 3.4 Optional The Optional type represents either a value of type A, or the lack of a value. A value of this type is immutable and provides two constructors, one providing a value, the other for providing no value. Properties are provided to test for validity and to obtain the value. An exception is thrown if an attempt to access a non- existent value. 3.5 Either The Either type represents either a value of type A, or a value of type B. A value of this type is immutable. P

copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
备案/许可证编号:苏ICP备17064731号-1