この規格 プレビューページの目次
※一部、英文及び仏文を自動翻訳した日本語訳を使用しています。
3 定義、構造および表記法
3.1 定義
ISO/IEC 10514 のこの部分の目的のために、ISO/IEC 10514-1 で与えられた定義と以下の定義が適用されます。
3.1.1 一般的な個別モジュール
型パラメータおよび/または定数値パラメータのいずれかである正式なパラメータを持つ、新しい種類の個別モジュール。汎用の個別モジュールは、実際の型や実際の定数式を使用してカスタマイズされた、それ自体の特定の改良を構築するためのテンプレートとして機能します。
注 1 —一般的な個別モジュールは、一般的な定義モジュールと一般的な実装モジュールで構成されます。汎用定義モジュールは、定義モジュールを改良できるテンプレートです。汎用実装モジュールは、実装モジュールを改良できるテンプレートです。
3.1.2 リファイナーまたはリファイニングモジュール
改良が行われている一般的な個別モジュールの改良を作成する目的で、実際のパラメータを提供する手段である新しい種類のモジュール。
注 2 —精緻化モジュールは別個のモジュールとすることができ、その場合、その定義モジュールは、精緻化が行われている一般的な別個のモジュールのジェネリック Modula-2 定義モジュールの精緻化を生成します。このような洗練された分離モジュールの実装モジュールは、改良が行われている一般的な分離モジュールの実装モジュールを改良する。
注 3 —洗練モジュールはローカル モジュールである可能性があり、その場合、その洗練は、それが洗練モジュールである一般的な定義モジュールで定義された項目を修飾されたエクスポート リストとして持ちます。このような改良ローカルモジュールは、改良が行われている汎用個別モジュールの実装モジュールを改良する。
3.1.3 改良
抽象エンティティ (モジュール全体またはモジュールに含まれるアイテムのいずれか)一般的な個別モジュールの仮パラメータを置き換えます。
注 4 —精製モジュールは、それから生成される精製と同じ実体ではありません。
3.1.4 改良
洗練モジュールを使用して、一般的な個別のモジュールから洗練を構築する行為。
注 5 —抽象的には、一般的な別個のモジュールを特定の改良に改良することは、翻訳者の仕事です。ただし、マルチパート標準のこのパートでは、この特定の翻訳タスクを他のタスクから分離する実装を排除するものは何もありません。たとえば、他の翻訳タスクの前に、改良を個別に実行できます。
注 6 —詳細化の効果は、一般的な個別モジュールの詳細化がベース言語で直接記述され、仮パラメータが実際のパラメータの評価結果に置き換えられた場合と同じです。 ISO/IEC 10514 のこの部分には、特定の中間体に関する要件がないため、実装戦略によっては、(抽象的な意味を除いて) 改良によってベース言語のプログラムが生成されると言っているのとはまったく同じではない場合があります。洗練がファイルとしていくつかの式を見つける形式。
用語に関する注意 — WG13 は、オブジェクト指向 Modula-2 で使用するために「インスタンス化」という用語をすでに使用しており、ISO 標準 Modula-2 でジェネリック拡張を使用して「洗練」を使用することを選択しました。
3.1.5 ジェネリック
アイテム自体にモジュール パラメーターが含まれているか必要であるかに関係なく、全体と、一般的な個別のモジュール内で定義された任意のアイテムの両方のプロパティ。
3.2 形式的定義の構造
マルチパート国際標準のこの部分は、現時点では VDM-SL に意味論の正式な表現が含まれていないことを除いて、基本言語と同じ形式でその要件を述べています。
3.3 規約
ISO/IEC 10514 のこの部分で使用される規則は、現時点では ISO/IEC 10514 のこの部分に VDM-SL が含まれていないことを除いて、基本言語と同じように解釈されます。
参考文献
| 1. | バーンズ、ジョン。 Ada 95 でのプログラミング。 Addison-Wesley: イギリス、ウォーキンガム、1996 |
| 2. | Harbison, Samuel P. Modula-3 。プレンティス・ホール:エングルウッド・クリフ、ニュージャージー州、1992年 |
| 3. | Hopper, Keith & Sutcliffe, Richard J. がModula-2 への Generic/Abstract 型拡張を提案(Canada #C89 WG13 #D211) 1994 |
| 4. | シルト、ハーバート。 C++ ゼロから。オズボーン・マグロウヒル: バークレー、1994 |
| 5. | Sutcliffe, Richard J.汎用プログラミングをサポートするための Modula-2 拡張(WG13 Wien-8 #D213) 1994 |
| 6. | Sutcliffe, Richard J. Modula-2 (C3/D11) 1987 における汎用データ型の議論 |
| Sutcliffe, Richard J. Generic Modula-2 (Canada #C93, C94, C95/D220, C96/D221, C101/D235, C103/D242) [この DIS の CD 版] | |
| 8番目。 | Sutcliffe, Richard J. Generic Modula-2 (Canada #C98, C100) 1995 に関するコメントへの応答 |
| 9. | サトクリフ、リチャード J. CD 10514-2 (ジェネリック) に関するコメントの処分(カナダ #C103/D241, C106/D247) 1997 |
| 10 | Sutcliffe, Richard J. DIS 10514-2 (情報技術 — プログラミング言語 — 2: Modula-2, Modula-2 のジェネリック) (カナダ #C109/D253) 1997 |
3 Definitions, Structure and Conventions
3.1 Definitions
For the purposes of this part of ISO/IEC 10514, the definitions given in ISO/IEC 10514-1 and the following definitions apply.
3.1.1 Generic separate module
A new kind of separate module having formal parameters that can be either type parameters and/or constant value parameters. A generic separate module serves as a template for constructing specific refinements of itself that have been customized using actual types and/or actual constant expressions.
NOTE 1 — A generic separate module consists of a generic definition module and a generic implementation module. The generic definition module is a template from which a definition module can be refined. The generic implementation module is a template from which an implementation module can be refined.
3.1.2 Refiner or Refining module
A new kind of module that is a means of supplying actual parameters for the purpose of creating a refinement of the generic separate module from which the refinement is being made.
NOTE 2 — A refining module can be a separate module, in which case its definition module produces a refinement of the Generic Modula-2 definition module of the generic separate module from which the refinement is being made. The implementation module of such a refining separate module refines the implementation module of the generic separate module from which the refinement is being made.
NOTE 3 — A refining module can be a local module, in which case its refinement has as its qualified export list the items defined in the generic definition module of which it is a refining module. Such a refining local module refines the implementation module of the generic separate module from which the refinement is being made.
3.1.3 Refinement
An abstract entity (either a whole module or an item it contains) constructed from a generic separate module by specifying in a refining module the name of a generic separate module to be refined from and actual types and/or actual constant expressions to evaluate and then substitute for the formal parameters of the generic separate module.
NOTE 4 — The refining module is not the same entity as the refinement produced from it.
3.1.4 Refine
The act of constructing a refinement from a generic separate module by using a refining module.
NOTE 5 — Abstractly, the refining of a generic separate module to a specific refinement is the task of the translator. Elowever, nothing in this part of the multi-part standard precludes an implementation separating this particular translation task from others. For instance, refinement could be performed separately before other translation tasks.
NOTE 6 — The effect of refinement is the same as if a refinement of the generic separate module had been written directly in the base language with the formal parameters replaced by the results of evaluating the actual parameters. Depending on the implementation strategy, this might not be quite the same as saying that refinement results in a program in the base language (except in the abstract sense), for there is no requirement in this part of ISO/IEC 10514 for a specific intermediate form in which a refinement finds some expression as a file.
TERMINOLOGY NOTE — WG13 is already using the term"instantiate" for use in Object Oriented Modula-2, and has chosen to use"refine" in ISO Standard Modula-2 with Generic extensions.
3.1.5 Generic
A property of both the whole and of any item defined within a generic separate module, regardless of whether the item itself contains or needs module parameters.
3.2 Structure of the Formal Definition
This part of the multi-part International Standard states its requirements in the same form as the Base Language with the exception that it does not include formal expression of semantics in VDM-SL at this time.
3.3 Conventions
The conventions used in this part of ISO/IEC 10514 are to be interpreted in the same way as in the Base Language with the exception that this part of ISO/IEC 10514 does not include VDM-SL at this time.
Bibliography
| 1. | Barnes, John. Programming in Ada 95. Addison-Wesley: Wokingham, England, 1996 |
| 2. | Harbison, Samuel P. Modula-3. Prentice Hall: Englewood Cliffs, NJ, 1992 |
| 3. | Hopper, Keith & Sutcliffe, Richard J. Proposed Generic/Abstract Type Extension To Modula-2 (Canada #C89 WG13 #D211) 1994 |
| 4. | Schildt, Herbert. C++ From the Ground Up. Osborne McGraw-Hill: Berkeley, 1994 |
| 5. | Sutcliffe, Richard J. Modula-2 Extension to Support Generic Programming (WG13 Wien-8 #D213) 1994 |
| 6. | Sutcliffe, Richard J. A Discussion of Generic Data Types in Modula-2 (C3/D11) 1987 |
| 7. | Sutcliffe, Richard J. Generic Modula-2 (Canada #C93, C94, C95/D220, C96/D221, C101/D235, C103/D242) [CD versions of this DIS] |
| 8. | Sutcliffe, Richard J. Responses to Comments on Generic Modula-2 (Canada #C98, C100) 1995 |
| 9. | Sutcliffe, Richard J. Disposition of Comments on CD 10514-2 (Generics) (Canada #C103/D241, C106/D247) 1997 |
| 10. | Sutcliffe, Richard J. Disposition of Comments on DIS 10514-2 (Information technology — Programming languages — 2: Modula-2, Generics in Modula-2) (Canada #C109/D253) 1997 |