DocAda(tm) is a productivity tool of KSCE

Prev | Up | Next | Back | Forward
About DocAda Light: Preface / Preliminary / Help / TOC / Copyright
DocAda Online at the Ada Home: Complete RM95 / Updates / News

7.5 Limited Types

A limited type is (a view of) a type for which the assignment operation is not allowed. A nonlimited type is a (view of a) type for which the assignment operation is allowed.

Legality Rules

If a tagged record type has any limited components, then the reserved word limited shall appear in its record_type_definition.

Static Semantics

A type is limited if it is a descendant of one of the following:

Otherwise, the type is nonlimited.

There are no predefined equality operators for a limited type.

Examples

Example of a package with a limited type:

    
       package IO_Package is
          type File_Name is limited private;

          procedure Open (F : in out File_Name);
          procedure Close(F : in out File_Name);
          procedure Read (F : in File_Name; Item : out Integer);
          procedure Write(F : in File_Name; Item : in  Integer);
       private
          type File_Name is
             limited record
                Internal_Name : Integer := 0;
             end record;
       end IO_Package;

       package body IO_Package is
          Limit : constant := 200;
          type File_Descriptor is record  ...  end record;
          Directory : array (1 .. Limit) of File_Descriptor;
          ...
          procedure Open (F : in out File_Name) is  ...  end;
          procedure Close(F : in out File_Name) is  ...  end;
          procedure Read (F : in File_Name; Item : out Integer) is ... end;
          procedure Write(F : in File_Name; Item : in  Integer) is ... end;
       begin
          ...
       end IO_Package;

About DocAda Light: Preface / Preliminary / Help / TOC / Copyright
DocAda Online at the Ada Home: Complete RM95 / Updates / News
Prev | Up | Next | Back | Forward


Copyright © 1994-1997 by Kempe Software Capital Enterprises. All Rights Reserved. For comments on this DocAda(tm) hypertext document, please write to KSCE, at docada@ksce.com