CS 131 LECTURE 5 - GENERIC UNITS


GENERIC CONCEPT

Types And Subprograms Are Static
Ada Generic Units
Operational Issues


GENERIC DECLARATIONS

Syntax Rules:
Important Points:


GENERIC FORMAL TYPE CLASSES

Formal Type Class Diagram

Generic Formal Type Class Characteristics


GENERIC SUBPROGRAM EXAMPLES

Generic Procedure
Generic Function


GENERIC SET PACKAGE


GENERIC VECTOR PACKAGE SPECIFICATION

Package Specification
Important Points:


GENERIC VECTOR PACKAGE BODY


GENERIC INSTANTIATION

Syntax Rules:
Important Point:


GENERIC INSTANTIATION EXAMPLES

Generic Function Instantiation
Generic Procedure Instantiation
Generic Package Instantiation


GENERIC FORMAL SUBPROGRAMS

Function With Generic Subprogram:
Purpose Of Function:
Function Instantiation With Square Terms:


GENERIC NUMERIC TYPES

Generic Vector Package With Generic Numeric Scalars:
Important Point:


ORDER OF COMPILATION

Compilation Order Rules:
Important Points: