International Standard ISO/IEC 8652:1995
Information technology -- Programming languages -- Ada
AMENDMENT 1 (Draft 12)
Technologies de l'information -- Langages de programmation -- Ada
AMENDEMENT 1
Amendment 1 to International Standard ISO/IEC 8652:1995 was
prepared by AXE Consultants.
© 2005, AXE Consultants. All Rights Reserved.
This document may be copied, in whole or in part, in any form or by any
means, as is, or with alterations, provided that (1) alterations are
clearly marked as alterations and (2) this copyright notice is included
unmodified in any copy. Compiled copies of standard library units and
examples need not contain this copyright notice so long as the notice is
included in all copies of the source code and documentation. Any other use
or distribution of this document is prohibited without the prior express
permission of AXE.
Introduction
International Standard ISO/IEC 8652:1995 defines the Ada programming language.
This amendment modifies Ada by making changes and additions that improve:
- The safety of applications written in Ada;
- The portability of applications written in Ada;
- Interoperability with other languages and systems; and
- Accessibility and ease of transition from idioms in other programming
and modeling languages.
This amendment incorporates the following major additions to the International Standard:
- The Ravenscar profile to provide a simplified tasking system for high-integrity systems (see clause D.13);
- A non-preemptive task dispatching policy (see clause D.2.4);
- Aggregates, constructor functions, and constants for limited types (see clauses 4.3.1, 6.5, and 7.5);
- Control of overriding to eliminate errors (see clause 8.3);
- Improvements for access types, such as null excluding subtypes (see clause 3.10), additional uses for anonymous access types (see clauses 3.6 and 8.5.1), and anonymous access-to-subprogram subtypes to support 'downward closures' (see clauses 3.10 and 3.10.2);
- Additional context clause capabilities: limited views to allow mutually dependent types (see clauses 3.10.1 and 10.1.2) and private context clauses that apply only in the private part of a package (see clause 10.1.2);
- Added standard packages, including time management (see 9.6), file directory and name management (see clause A.16), containers (see clause A.17), execution-time clocks (see clause D.14), timing events (see clause D.15), and array and vector operations (see clause G.3);
- Interfaces, to provide a limited form of multiple inheritance of operations (see clause 3.9.4); and
- A mechanism for writing C unions to make interfaces with C systems easier (see clause B.3.3).
This Amendment is organized by sections corresponding to those in the International
Standard. These sections include wording changes and additions to the International
Standard. Clause and subclause headings are given for each clause that contains a
wording change. Clauses and subclauses that do not contain any change or addition
are omitted.
For each change, an anchor paragraph from the International Standard (as corrected
by Technical Corrigendum 1) is given. New or revised text and instructions are
given with each change. The anchor paragraph can be
replaced or deleted, or text can be inserted before or after it. When a heading immediately
precedes the anchor paragraph, any text inserted before the paragraph is intended
to appear under the heading.
Typographical conventions:
Instructions about the text changes are in this font.
The actual text changes are in the same fonts as the International Standard -
this font for text,
this font for syntax,
and this font for Ada source code.
Note that this document is designed to be viewed with the default font as some Roman font,
similar to the Ada 95 standard. This may require some adjustments to your browser.
Disclaimer:
This document is a draft of a possible amendment to Ada 95 (International
Standard ISO/IEC 8652:1995). This draft contains only proposals substantially
approved by the ISO/IEC JTC 1/SC 22/WG 9 Ada Rapporteur Group (ARG). Many
other important proposals are under consideration by the ARG. Neither
the ARG nor any other group has determined which, if any, of these
proposals will be included in the amendment. Any proposal may be
substantially changed or withdrawn before this document begins
standardization, and other proposals may be added. This document is not an
official publication or work product of the ARG.
Foreword and Introduction
Introduction
Replace paragraph 3: [AI95-00387-01]
-
Rationale for the Ada Programming Language -- 1995 edition, which
gives an introduction to the new features of Ada, and explains the rationale
behind them. Programmers should read this first.
by:
-
Ada 95 Rationale. This gives an introduction to the new features of
Ada incorporated in the 1995 edition of this Standard, and explains
the rationale behind them. Programmers unfamiliar with Ada 95 should
read this first.
-
Ada 2006 Rationale. This gives an introduction to the changes and new
features in Ada 2006 (compared with the 1995 edition), and explains
the rationale behind them. Programmers should read this rationale
before reading this Standard in depth.
Replace paragraph 5: [AI95-00387-01]
-
The Annotated Ada Reference Manual (AARM). The AARM contains all of
the text in the RM95, plus various annotations. It is intended primarily for
compiler writers, validation test writers, and others who wish to study the
fine details. The annotations include detailed rationale for individual rules
and explanations of some of the more arcane interactions among the rules.
by:
-
The Annotated Ada Reference Manual (AARM). The AARM contains all of
the text in the consolidated Ada Reference Manual, plus various annotations. It
is intended primarily for compiler writers, validation test writers, and others
who wish to study the fine details. The annotations include detailed rationale
for individual rules and explanations of some of the more arcane interactions
among the rules.
Replace paragraph 6: [AI95-00387-01]
Ada was originally designed with three overriding concerns: program reliability
and maintenance, programming as a human activity, and efficiency. This revision
to the language was designed to provide greater flexibility and extensibility,
additional control over storage management and synchronization, and
standardized packages oriented toward supporting important application areas,
while at the same time retaining the original emphasis on reliability,
maintainability, and efficiency.
by:
Ada was originally designed with three overriding concerns: program reliability
and maintenance, programming as a human activity, and efficiency. The 1995
revision to the language was designed to provide greater flexibility and
extensibility, additional control over storage management and synchronization,
and standardized packages oriented toward supporting important application
areas, while at the same time retaining the original emphasis on reliability,
maintainability, and efficiency. This amended version provides further
flexibility and adds more standardized packages within the framework provided
by the 1995 revision.
Replace paragraph 32: [AI95-00285-01; AI95-00387-01]
An enumeration type defines an ordered set of distinct enumeration literals,
for example a list of states or an alphabet of characters. The enumeration
types Boolean, Character, and Wide_Character are predefined.
by:
An enumeration type defines an ordered set of distinct enumeration literals,
for example a list of states or an alphabet of characters. The enumeration
types Boolean, Character, Wide_Character, and Wide_Wide_Character are
predefined.
Replace paragraph 34: [AI95-00285-01; AI95-00387-01]
Composite types allow definitions of structured objects with related
components. The composite types in the language include arrays and records. An
array is an object with indexed components of the same type. A record is an
object with named components of possibly different types. Task and protected
types are also forms of composite types. The array types String and Wide_String
are predefined.
by:
Composite types allow definitions of structured objects with related
components. The composite types in the language include arrays and records. An
array is an object with indexed components of the same type. A record is an
object with named components of possibly different types. Task and protected
types are also forms of composite types. The array types String, Wide_String,
and Wide_Wide_String are predefined.
Insert after paragraph 38: [AI95-00387-01]
From any type a new type may be defined by derivation. A type, together with
its derivatives (both direct and indirect) form a derivation class. Class-wide
operations may be defined that accept as a parameter an operand of any type in
a derivation class. For record and private types, the derivatives may be
extensions of the parent type. Types that support these object-oriented
capabilities of class-wide operations and type extension must be tagged, so
that the specific type of an operand within a derivation class can be
identified at run time. When an operation of a tagged type is applied to an
operand whose specific type is not known until run time, implicit dispatching
is performed based on the tag of the operand.
the new paragraph:
Interface types provide abstract models from which other interfaces and types
may be composed and derived. This provides a reliable form of multiple
inheritance. Interface types may also be implemented by synchronized types
(task types and protected types) thereby enabling concurrent programming and
inheritance to be merged.
Replace paragraph 41: [AI95-00387-01]
Representation clauses can be used to specify the mapping between types and
features of an underlying machine. For example, the user can specify that
objects of a given type must be represented with a given number of bits, or
that the components of a record are to be represented using a given storage
layout. Other features allow the controlled use of low level, nonportable, or
implementation-dependent aspects, including the direct insertion of machine
code.
by:
Aspect clauses can be used to specify the mapping between types and
features of an underlying machine. For example, the user can specify that
objects of a given type must be represented with a given number of bits, or
that the components of a record are to be represented using a given storage
layout. Other features allow the controlled use of low level, nonportable, or
implementation-dependent aspects, including the direct insertion of machine
code.
Replace paragraph 42: [AI95-00387-01]
The predefined environment of the language provides for input-output and other
capabilities (such as string manipulation and random number generation) by
means of standard library packages. Input-output is supported for values of
user-defined as well as of predefined types. Standard means of representing
values in display form are also provided. Other standard library packages are
defined in annexes of the standard to support systems with specialized
requirements.
by:
The predefined environment of the language provides for input-output and other
capabilities by
means of standard library packages. Input-output is supported for values of
user-defined as well as of predefined types. Standard means of representing
values in display form are also provided.
The predefined standard library packages provide facilities such as string
manipulation, containers of various kinds (vectors, lists, maps etc.),
mathematical functions, random number generation, and access to the
execution environment.
The specialized annexes define further predefined library packages and
facilities with emphasis on areas such as real-time scheduling,
interrupt handling, distributed systems, numerical computation, and
high-integrity systems.
Replace paragraph 44: [AI95-00387-01]
This International Standard replaces the first edition of 1987. In this
edition, the following major language changes have been incorporated:
by:
This amended International Standard updates the edition of 1995 which
replaced the first edition of 1987. In the 1995 edition, the following
major language changes were incorporated:
Replace paragraph 45: [AI95-00387-01]
-
Support for standard 8-bit and 16-bit character sets. See Section 2,
3.5.2, 3.6.3, A.1, A.3, and A.4.
by:
-
Support for standard 8-bit and 16-bit characters was added. See
clauses 2.1, 3.5.2, 3.6.3, A.1, A.3, and A.4.
Replace paragraph 46: [AI95-00387-01]
-
Object-oriented programming with run-time polymorphism. See the
discussions of classes, derived types, tagged types, record extensions, and
private extensions in clauses 3.4, 3.9, and 7.3. See also the new forms of
generic formal parameters that are allowed by 12.5.1, ``Formal Private and
Derived Types'' and 12.7, ``Formal Packages''.
by:
-
The type model was extended to include facilities for object-oriented
programming with dynamic polymorphism. See the discussions of classes, derived
types, tagged types, record extensions, and private extensions in clauses 3.4,
3.9, and 7.3. Additional forms of generic formal parameters were allowed as
described in clauses 12.5.1 and 12.7.
Replace paragraph 47: [AI95-00387-01]
-
Access types have been extended to allow an access value to designate
a subprogram or an object declared by an object declaration (as opposed to just
a heap-allocated object). See 3.10.
by:
-
Access types were extended to allow an access value to designate a
subprogram or an object declared by an object declaration as opposed to
just an object allocated on a heap. See clause 3.10.
Replace paragraph 48: [AI95-00387-01]
-
Efficient data-oriented synchronization is provided via protected
types. See Section 9.
by:
-
Efficient data-oriented synchronization was provided by the
introduction of protected types. See clause 9.4.
Replace paragraph 49: [AI95-00387-01]
-
The library units of a library may be organized into a hierarchy of
parent and child units. See Section 10.
by:
-
The library structure was extended to allow library units to be
organized into a hierarchy of parent and child units. See clause 10.1.
Replace paragraph 50: [AI95-00387-01]
-
Additional support has been added for interfacing to other languages.
See Annex B.
by:
-
Additional support was added for interfacing to other languages.
See Annex B.
Replace paragraph 51: [AI95-00387-01]
-
The Specialized Needs Annexes have been added to provide specific
support for certain application areas:
by:
-
The Specialized Needs Annexes were added to provide specific support
for certain application areas:
Replace paragraph 57: [AI95-00387-01]
-
Annex H, ``Safety and Security''
by:
-
Annex H, ``High Integrity Systems''
Amendment 1 modifies the 1995 International Standard by making changes and
additions that improve the capability of the language and the reliability of
programs written in the language. In particular the changes were designed to
improve the portability of programs, interfacing to other languages, and
both the object-oriented and real-time capabilities.
The following significant changes with respect to the 1995 edition are
incorporated:
-
Support for program text is extended to cover the entire ISO/IEC
10646:2003 repertoire. Execution support now includes the 32-bit character
set. See clauses 2.1, 3.5.2, 3.6.3, A.1, A.3, and A.4.
-
The object-oriented model has been improved by the addition of an
interface facility which provides multiple inheritance and additional
flexibility for type extensions. See clauses 3.4, 3.9, and 7.3. An
alternative notation for calling operations more akin to that used in
other languages has also been added. See clause 4.1.3.
-
Access types have been further extended to unify properties such as
the ability to access constants and to exclude null values. See clause
3.10. Anonymous access types are now permitted more freely and anonymous
access-to-subprogram types are introduced. See clauses 3.3, 3.6, 3.10, and
8.5.1.
-
The control of structure and visibility has been enhanced to
permit mutually dependent references between units and finer control
over access from the private part of a package. See clauses 3.10.1 and
10.1.2. In addition, limited types have been made more useful by the
provision of aggregates, constants, and constructor functions. See clauses
4.3, 6.5, and 7.5.
-
The predefined environment has been extended to include additional time
and calendar operations, improved string handling, a comprehensive
container library, file and directory management, and access to
environment variables. See clauses 9.6.1, A.4, A.16, A.17, and A.18.
-
Two of the Specialized Needs Annexes have been considerably enhanced:
-
The Real-Time Systems Annex now includes the Ravenscar profile for
high-integrity systems, further dispatching policies such as Round Robin
and Earliest Deadline First, support for timing events, and support for
control of CPU time utilization. See clauses D.2, D.13, D.14, and D.15.
-
The Numerics Annex now includes support for real and complex vectors
and matrices as previously defined in ISO/IEC 13813:1997 plus further basic
operations for linear algebra. See clause G.3.
-
The overall reliability of the language has been enhanced by a number
of improvements. These include new syntax which detects accidental overloading,
as well as pragmas for making assertions and giving better control over the
suppression of checks. See clauses 6.1, 11.4.2, and 11.5.
Section 1: General
1.1.2 Structure
Replace paragraph 13: [AI95-00347-01]
-
Annex H, ``Safety and Security''
by:
-
Annex H, ``High Integrity Systems''
1.1.4 Method of Description and Syntax Notation
Replace paragraph 9: [AI95-00433-01]
return_statement ::= return [expression];
return_statement ::= return; | return expression;
by:
simple_return_statement ::= return [expression];
simple_return_statement ::= return; | return expression;
Insert after paragraph 14: [AI95-00285-01]
-
If the name of any syntactic category starts with an italicized part,
it is equivalent to the category name without the italicized part. The
italicized part is intended to convey some semantic information. For example
subtype_name and task_name are both equivalent to name alone.
the new paragraph:
The delimiters, compound delimiters, reserved words, and numeric_literals
are exclusively made of the characters whose code position is between
16#20# and 16#7E#, inclusively. The special characters for which names
are defined in this International Standard (see 2.1) belong to the same
range. For example, the character E in the definition of exponent is the
character whose name is "LATIN CAPITAL LETTER E", not "GREEK CAPITAL
LETTER EPSILON".
Insert before paragraph 15: [AI95-00395-01]
A syntactic category is a nonterminal in the grammar defined in BNF under
"Syntax." Names of syntactic categories are set in a different font,
like_this.
the new paragraph:
When this International Standard mentions the conversion of some character or
sequence of characters to upper case, it means the character or sequence of
characters obtained by using locale-independent full case folding, as defined
by documents referenced in the note in section 1 of ISO/IEC 10646:2003.
1.2 Normative References
Replace paragraph 3: [AI95-00415-01]
ISO/IEC 1539:1991, Information technology — Programming languages
— FORTRAN.
by:
ISO/IEC 1539-1:2004, Information technology — Programming languages
— Fortran — Part 1: Base language.
Replace paragraph 4: [AI95-00415-01]
ISO 1989:1985, Programming languages — COBOL.
by:
ISO/IEC 1989:2002, Information technology — Programming languages — COBOL.
Insert after paragraph 5: [AI95-00351-01]
ISO/IEC 6429:1992, Information technology — Control functions for coded
graphic character sets.
the new paragraph:
ISO 8601:2004, Data elements and interchange formats — Information
interchange — Representation of dates and times.
Replace paragraph 7: [AI95-00415-01]
ISO/IEC 9899:1990, Programming languages — C.
by:
ISO/IEC 9899:1999, Programming languages — C,
supplemented by Technical Corrigendum 1:2001 and Technical Corrigendum 2:2004.
Replace paragraph 8: [AI95-00285-01; AI95-00376-01]
ISO/IEC 10646-1:1993, Information technology — Universal Multiple-Octet Coded
Character Set (UCS) — Part 1: Architecture and Basic Multilingual Plane,
supplemented by Technical Corrigendum 1:1996.
by:
ISO/IEC 10646:2003, Information technology — Universal Multiple-Octet
Coded Character Set (UCS).
ISO/IEC 14882:2003, Programming languages — C++.
ISO/IEC TR 19769:2004, Information technology — Programming languages,
their environments and system software inferfaces — Extensions for the
programming language C to support new character data types.
1.3 Definitions
Replace paragraph 1: [AI95-00415-01]
Terms are defined throughout this International Standard, indicated by
italic type. Terms explicitly defined in this International Standard are
not to be presumed to refer implicitly to similar terms defined elsewhere.
Terms not defined in this International Standard are to be interpreted
according to the Webster's Third New International Dictionary of the English
Language. Informal descriptions of some terms are also given in Annex N,
"Glossary".
by:
Terms are defined throughout this International Standard, indicated by
italic type. Terms explicitly defined in this International Standard are
not to be presumed to refer implicitly to similar terms defined elsewhere.
Mathematical terms not defined in this International Standard are to be
interpreted according to the CRC Concise Encyclopedia of Mathematics,
Second Edition. Other terms not defined in this International Standard are to
be interpreted according to the Webster's Third New International Dictionary
of the English Language. Informal descriptions of some terms are also given in
Annex N, "Glossary".
Section 2: Lexical Elements
2.1 Character Set
Replace paragraph 1: [AI95-00285-01; AI95-00395-01]
The only characters allowed outside of comments are the
graphic_characters and format_effectors.
by:
The character repertoire for the text of an Ada program consists of the
collection of characters described by the ISO/IEC 10646:2003 Universal
Multiple-Octet Coded Character Set. This collection is organized in planes,
each plane comprising 65536 characters.
Delete paragraph 2: [AI95-00285-01]
character ::= graphic_character | format_effector | other_control_function
Replace paragraph 3: [AI95-00285-01; AI95-00395-01]
graphic_character ::= identifier_letter | digit | space_character | special_character
by:
A character is any character defined within ISO/IEC 10646:2003
other than those whose relative code position in their plane is 16#FFFE# or
16#FFFF#.
Replace paragraph 4: [AI95-00285-01; AI95-00395-01]
The character repertoire for the text of an Ada program consists of the
collection of characters called the Basic Multilingual Plane (BMP) of the ISO
10646 Universal Multiple-Octet Coded Character Set, plus a set of
format_effectors and, in comments only, a set of
other_control_functions; the coded representation for these characters is
implementation defined (it need not be a representation defined within
ISO-10646-1).
by:
The coded representation for characters is implementation defined (it need not
be a representation defined within ISO/IEC 10646:2003). A character whose
relative code position in its plane is 16#FFFE# or 16#FFFF# is not allowed
anywhere in the text of a program.
The semantics of an Ada program whose text is not in Normalization Form KC (as
defined by section 24 of ISO/IEC 10646:2003) is implementation defined.
Replace paragraph 5: [AI95-00285-01]
The description of the language definition in this International Standard uses
the graphic symbols defined for Row 00: Basic Latin and Row 00: Latin-1
Supplement of the ISO 10646 BMP; these correspond to the graphic symbols of ISO
8859-1 (Latin-1); no graphic symbols are used in this International Standard
for characters outside of Row 00 of the BMP. The actual set of graphic symbols
used by an implementation for the visual representation of the text of an Ada
program is not specified.
by:
The description of the language definition in this International Standard uses
the character properties General Category, Simple Uppercase Mapping, Uppercase
Mapping, and Special Case Condition of the documents referenced by the note in
section 1 of ISO/IEC 10646:2003. The actual set of graphic symbols used by an
implementation for the visual representation of the text of an Ada program is
not specified.
Replace paragraph 6: [AI95-00285-01]
The categories of characters are defined as follows:
by:
Characters are categorized as follows:
Delete paragraph 7: [AI95-00285-01]
- identifier_letter
-
upper_case_identifier_letter | lower_case_identifier_letter
Replace paragraph 8: [AI95-00285-01]
- upper_case_identifier_letter
-
Any character of Row 00 of ISO 10646 BMP whose name begins ``Latin Capital Letter''.
by:
- letter_uppercase
-
Any character whose General Category is defined to be "Letter, Uppercase".
Replace paragraph 9: [AI95-00285-01]
- lower_case_identifier_letter
-
Any character of Row 00 of ISO 10646 BMP whose name begins ``Latin Small Letter''.
by:
- letter_lowercase
-
Any character whose General Category is defined to be "Letter, Lowercase".
- letter_titlecase
-
Any character whose General Category is defined to be "Letter, Titlecase".
- letter_modifier
-
Any character whose General Category is defined to be "Letter, Modifier".
- letter_other
-
Any character whose General Category is defined to be "Letter, Other".
- mark_non_spacing
-
Any character whose General Category is defined to be "Mark, Non-Spacing".
- mark_spacing_combining
-
Any character whose General Category is defined to be "Mark, Spacing Combining".
Replace paragraph 10: [AI95-00285-01]
- digit
-
One of the characters 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9.
by:
- number_decimal_digit
-
Any character whose General Category is defined to be "Number, Decimal Digit".
- number_letter
-
Any character whose General Category is defined to be "Number, Letter".
- punctuation_connector
-
Any character whose General Category is defined to be "Punctuation, Connector".
- other_format
-
Any character whose General Category is defined to be "Other, Format".
Replace paragraph 11: [AI95-00285-01]
- space_character
-
The character of ISO 10646 BMP named ``Space''.
by:
- separator_space
-
Any character whose General Category is defined to be "Separator, Space".
Replace paragraph 12: [AI95-00285-01]
- special_character
-
Any character of the ISO 10646 BMP that is not reserved for a control function,
and is not the space_character, an identifier_letter, or a
digit.
by:
- separator_line
-
Any character whose General Category is defined to be "Separator, Line".
- separator_paragraph
-
Any character whose General Category is defined to be "Separator, Paragraph".
Replace paragraph 13: [AI95-00285-01]
- format_effector
-
The control functions of ISO 6429 called character tabulation (HT), line
tabulation (VT), carriage return (CR), line feed (LF), and form feed (FF).
by:
- format_effector
-
The characters whose code positions are 16#09# (CHARACTER TABULATION), 16#0A#
(LINE FEED(LF)), 16#0B# (LINE TABULATION), 16#0C# (FORM FEED(FF)), 16#0D#
(CARRIAGE RETURN(CR)), 16#85# (NEXT LINE(NEL)), and the characters in
categories separator_line and separator_paragraph. The names
mentioned in parentheses in this list are not defined by ISO/IEC 10646:2003;
they are only used for convenience in this International Standard.
- other_control
-
Any character whose General Category is defined to be "Other, Control", and
which is not defined to be a format_effector.
- other_private_use
-
Any character whose General Category is defined to be "Other, Private Use".
- other_surrogate
-
Any character whose General Category is defined to be "Other, Surrogate".
Replace paragraph 14: [AI95-00285-01; AI95-00395-01]
- other_control_function
-
Any control function, other than a format_effector, that is allowed in a
comment; the set of other_control_functions allowed in comments is
implementation defined.
by:
- graphic_character
-
Any character which is not in the categories other_control,
other_private_use, other_surrogate, format_effector, and whose
relative code position in its plane is neither 16#FFFE# nor 16#FFFF#.
Replace paragraph 15: [AI95-00285-01]
The following names are used when referring to certain special_characters:
by:
The following names are used when referring to certain characters (the first
name is that given in ISO/IEC 10646:2003):
Delete paragraph 16: [AI95-00285-01]
In a nonstandard mode, the implementation may support a different character
repertoire; in particular, the set of characters that are considered
identifier_letters can be extended or changed to conform to local
conventions.
Replace paragraph 17: [AI95-00285-01]
1 Every code position of ISO 10646 BMP that is not reserved for a
control function is defined to be a graphic_character by this International
Standard. This includes all code positions other than 0000 - 001F, 007F -
009F, and FFFE - FFFF.
by:
1 The characters in categories other_control,
other_private_use, and other_surrogate are only allowed in comments.
2.2 Lexical Elements, Separators, and Delimiters
Replace paragraph 2: [AI95-00285-01]
The text of a compilation is divided into lines.
In general, the representation for an end of line is implementation defined.
However, a sequence of one or more format_effectors other
than character tabulation (HT) signifies at least one end of line.
by:
The text of a compilation is divided into lines.
In general, the representation for an end of line is implementation defined.
However, a sequence of one or more format_effectors other
than the character whose code position
is 16#09# (CHARACTER TABULATION) signifies at least one end of line.
Replace paragraph 3: [AI95-00285-01]
In some cases an explicit separator is required to separate adjacent
lexical elements. A separator is any of a space character, a format effector,
or the end of a line, as follows:
by:
In some cases an explicit separator is required to separate adjacent
lexical elements. A separator is any of a separator_space, a
format_effector, or the end of a line, as follows:
Replace paragraph 4: [AI95-00285-01]
-
A space character is a separator except within a comment,
a string_literal, or a character_literal.
by:
-
A separator_space is a separator except within a comment, a
string_literal, or a character_literal.
Replace paragraph 5: [AI95-00285-01]
-
Character tabulation (HT) is a separator except within a comment.
by:
-
The character whose code position is 16#09# (CHARACTER TABULATION)
is a separator except within a comment.
Replace paragraph 8: [AI95-00285-01]
A delimiter is either one of the following special characters
by:
A delimiter is either one of the following characters:
2.3 Identifiers
Replace paragraph 2: [AI95-00285-01; AI95-00395-01]
identifier ::=
identifier_letter {[underline] letter_or_digit}
by:
identifier ::=
identifier_start {identifier_start | identifier_extend}
Replace paragraph 3: [AI95-00285-01; AI95-00395-01]
letter_or_digit ::= identifier_letter | digit
by:
identifier_start ::=
letter_uppercase
| letter_lowercase
| letter_titlecase
| letter_modifier
| letter_other
| number_letter
identifier_extend ::=
mark_non_spacing
| mark_spacing_combining
| number_decimal_digit
| punctuation_connector
| other_format
Replace paragraph 4: [AI95-00395-01]
An identifier shall not be a reserved word.
by:
After eliminating the characters in category other_format, an
identifier shall not contain two consecutive characters in category
punctuation_connector, or end with a character in that category.
Replace paragraph 5: [AI95-00285-01; AI95-00395-01]
All characters of an identifier are significant, including any underline
character. Identifiers differing only in the use of corresponding upper
and lower case letters are considered the same.
by:
Two identifiers are considered the same if they consist of the same
sequence of characters after applying the following transformations (in
this order):
-
The characters in category other_format are eliminated.
-
The remaining sequence of characters is converted to upper case.
Replace paragraph 6: [AI95-00285-01; AI95-00395-01]
In a nonstandard mode, an implementation may support other upper/lower case
equivalence rules for identifiers, to accommodate local conventions.
by:
After applying these transformations, an identifier shall not be identical
to a reserved word (in upper case).
In a nonstandard mode, an implementation may support other upper/lower case
equivalence rules for identifiers, to accommodate local conventions.
NOTES
3 Identifiers differing only in the use of corresponding upper and
lower case letters are considered the same.
Replace paragraph 8: [AI95-00433-01]
Count X Get_Symbol Ethelyn Marion
Snobol_4 X1 Page_Count Store_Next_Item
by:
Count X Get_Symbol Ethelyn Marion
Snobol_4 X1 Page_Count Store_Next_Item
Πλάτων -- Plato
Чайковский -- Tchaikovsky
θ φ -- Angles
2.4.1 Decimal Literals
Insert after paragraph 5: [AI95-00285-01]
exponent ::= E [+] numeral | E - numeral
the new paragraph:
digit ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
2.5 Character Literals
Replace paragraph 5: [AI95-00433-01]
'A' '*' ''' ' '
by:
'A' '*' ''' ' '
'L' 'Л' 'Λ' -- various els
'∞' 'א' -- Big numbers - infinity and aleph
2.6 String Literals
Insert after paragraph 7: [AI95-00285-01]
NOTES
6 An end of line cannot appear in a string_literal.
the new paragraph:
7 No transformation is performed on the sequence of
characters in a string_literal.
Replace paragraph 9: [AI95-00433-01]
"Message of the day:"
"" -- a null string literal
" " "A" """" -- three string literals of length 1
"Characters such as $, %, and } are allowed in string literals"
by:
"Message of the day:"
"" -- a null string literal
" " "A" """" -- three string literals of length 1
"Characters such as $, %, and } are allowed in string literals"
"Archimedes said ""Εύρηκα"""
"Volume of cylinder (πr²h) = "
2.8 Pragmas
Replace paragraph 29: [AI95-00433-01]
pragma List(Off); -- turn off listing generation
pragma Optimize(Off); -- turn off optional optimizations
pragma Inline(Set_Mask); -- generate code for Set_Mask inline
pragma Suppress(Range_Check, On => Index); -- turn off range checking on Index
by:
pragma List(Off); -- turn off listing generation
pragma Optimize(Off); -- turn off optional optimizations
pragma Inline(Set_Mask); -- generate code for Set_Mask inline
pragma Import(C, Put_Char, External_Name => "putchar"); -- import C putchar function
2.9 Reserved Words
In paragraph 2 replace: [AI95-00284-02; AI95-00395-01]
The following are the reserved words (ignoring upper/lower case distinctions):
by:
The following are the reserved words. Within a program, some or all of the
letters of a reserved word may be in upper case, and one or more characters in
category other_format may be inserted within or at the end of the reserved
word.
In the list in paragraph 2, add: [AI95-00284-02; AI95-00395-01]
interface
overriding
synchronized
Section 3: Declarations and Types
3.1 Declarations
Replace paragraph 3: [AI95-00348-01]
basic_declaration ::=
type_declaration | subtype_declaration
| object_declaration | number_declaration
| subprogram_declaration | abstract_subprogram_declaration
| package_declaration | renaming_declaration
| exception_declaration | generic_declaration
| generic_instantiation
by:
basic_declaration ::=
type_declaration | subtype_declaration
| object_declaration | number_declaration
| subprogram_declaration | abstract_subprogram_declaration
| null_procedure_declaration | package_declaration
| renaming_declaration | exception_declaration
| generic_declaration | generic_instantiation
3.2 Types and Subtypes
Replace paragraph 4: []
The composite types are the record types, record extensions, array
types, task types, and protected types. A private type or
private extension represents a partial view (see 7.3) of a type, providing
support for data abstraction. A partial view is a composite type.
by:
The composite types are the record types, record extensions, array
types, interface types, task types, and protected types.
There can be multiple views of a type with varying sets of operations. An
incomplete type represents an incomplete view (see 3.10.1) of a type with a
very restricted usage, providing support for recursive data structures. A
private type or private extension represents a partial view (see 7.3)
of a type, providing support for data abstraction. The full view (see 3.2.1) of
a type represents its complete definition. An incomplete or partial view is
considered a composite type, even if the full view is not.
Replace paragraph 5: [AI95-00326-01]
Certain composite types (and partial views thereof) have special components
called discriminants whose values affect the presence, constraints, or
initialization of other components. Discriminants can be thought of as
parameters of the type.
by:
Certain composite types (and views thereof) have special components
called discriminants whose values affect the presence, constraints, or
initialization of other components. Discriminants can be thought of as
parameters of the type.
Replace paragraph 6: [AI95-00366-01]
The term subcomponent is used in this International Standard in place of
the term component to indicate either a component, or a component of another
subcomponent. Where other subcomponents are excluded, the term component is
used instead. Similarly, a part of an object or value is used to mean the
whole object or value, or any set of its subcomponents.
by:
The term subcomponent is used in this International Standard in place of
the term component to indicate either a component, or a component of another
subcomponent. Where other subcomponents are excluded, the term component is
used instead. Similarly, a part of an object or value is used to mean the
whole object or value, or any set of its subcomponents.
The terms component, subcomponent, and part are also applied to a type
meaning the component, subcomponent, or part of objects and values of the type.
Replace paragraph 7: [AI95-00231-01]
The set of possible values for an object of a given type can be subjected to a
condition that is called a constraint (the case of a null
constraint that specifies no restriction is also included); the rules for
which values satisfy a given kind of constraint are given in 3.5 for
range_constraints, 3.6.1 for index_constraints, and 3.7.1 for
discriminant_constraints.
by:
The set of possible values for an object of a given type can be subjected to a
condition that is called a constraint (the case of a null
constraint that specifies no restriction is also included); the rules for
which values satisfy a given kind of constraint are given in 3.5 for
range_constraints, 3.6.1 for index_constraints, and 3.7.1 for
discriminant_constraints. The set of possible values for an object of an
access type can also be subjected to a condition that excludes the null
value (see 3.10).
Replace paragraph 8: [AI95-00231-01; AI95-00415-01]
A subtype of a given type is a combination of the type,
a constraint on values of the type, and certain
attributes specific to the subtype.
The given type is called the type of the subtype.
Similarly, the associated constraint is called the
constraint of the subtype. The set of values
of a subtype consists of the values of its type
that satisfy its constraint.
Such values belong to the subtype.
by:
A subtype of a given type is a combination of the type,
a constraint on values of the type, and certain
attributes specific to the subtype.
The given type is called the type of the subtype.
Similarly, the associated constraint is called the
constraint of the subtype. The set of values
of a subtype consists of the values of its type
that satisfy its constraint and, in the case
of a subtype that excludes null, the values do not
include the null value. Such values belong to the subtype.
Replace paragraph 12: [AI95-00345-01]
all types
elementary
scalar
discrete
enumeration
character
boolean
other enumeration
integer
signed integer
modular integer
real
floating point
fixed point
ordinary fixed point
decimal fixed point
access
access-to-object
access-to-subprogram
composite
array
string
other array
untagged record
tagged
task
protected
by:
all types
elementary
scalar
discrete
enumeration
character
boolean
other enumeration
integer
signed integer
modular integer
real
floating point
fixed point
ordinary fixed point
decimal fixed point
access
access-to-object
access-to-subprogram
composite
noninterface
array
string
other array
record
task
protected
interface
nonlimited interface
limited interface
synchronized interface
task interface
protected interface
Replace paragraph 13: [AI95-00345-01]
The classes "numeric" and "nonlimited" represent other
classification dimensions and do not fit into the above strictly hierarchical
picture.
by:
There are other classes, such as "numeric" and "tagged", which
represent other classification dimensions, but do not fit
into the above strictly hierarchical picture.
3.2.1 Type Declarations
Replace paragraph 4: [AI95-00251-01]
type_definition ::=
enumeration_type_definition | integer_type_definition
| real_type_definition | array_type_definition
| record_type_definition | access_type_definition
| derived_type_definition
by:
type_definition ::=
enumeration_type_definition | integer_type_definition
| real_type_definition | array_type_definition
| record_type_definition | access_type_definition
| derived_type_definition | interface_type_definition
Replace paragraph 7: [AI95-00230-01]
A type defined by a type_declaration is a named type;
such a type has one or more nameable subtypes.
Certain other forms of declaration also include type
definitions as part of the declaration for an object (including a
parameter or a discriminant). The type defined by such
a declaration is anonymous — it has no nameable subtypes.
For explanatory purposes, this International Standard sometimes refers to
an anonymous type by a pseudo-name, written in italics, and
uses such pseudo-names at places where the syntax normally requires
an identifier. For a named type whose first subtype is T,
this International Standard sometimes refers to the type of T
as simply "the type T."
by:
A type defined by a type_declaration is a named type;
such a type has one or more nameable subtypes.
Certain other forms of declaration also include type
definitions as part of the declaration for an object. The type defined
by such a declaration is anonymous — it has no nameable subtypes.
For explanatory purposes, this International Standard sometimes refers to
an anonymous type by a pseudo-name, written in italics, and
uses such pseudo-names at places where the syntax normally requires
an identifier. For a named type whose first subtype is T,
this International Standard sometimes refers to the type of T
as simply "the type T".
Replace paragraph 8: [AI95-00230-01; AI95-00326-01]
A named type that is declared by a full_type_declaration, or an anonymous
type that is defined as part of declaring an object of the type, is called a
full type. The type_definition, task_definition,
protected_definition, or access_definition that defines a full type
is called a full type definition. Types declared by other forms of
type_declaration are not separate types; they are partial or incomplete
views of some full type.
by:
A named type that is declared by a full_type_declaration, or an anonymous
type that is defined by an access_definition or as part of declaring
an object of the type, is called a full type. The declaration of a
full type also declares the full view of the type. The
type_definition, task_definition, protected_definition, or
access_definition that defines a full type is called a full type
definition. Types declared by other forms of type_declaration are not
separate types; they are partial or incomplete views of some full type.
3.2.2 Subtype Declarations
Replace paragraph 3: [AI95-00231-01]
subtype_indication ::= subtype_mark [constraint]
by:
subtype_indication ::= [null_exclusion] subtype_mark [constraint]
Replace paragraph 15: [AI95-00433-01]
subtype Rainbow is Color range Red .. Blue; -- see 3.2.1
subtype Red_Blue is Rainbow;
subtype Int is Integer;
subtype Small_Int is Integer range -10 .. 10;
subtype Up_To_K is Column range 1 .. K; -- see 3.2.1
subtype Square is Matrix(1 .. 10, 1 .. 10); -- see 3.6
subtype Male is Person(Sex => M); -- see 3.10.1
by:
subtype Rainbow is Color range Red .. Blue; -- see 3.2.1
subtype Red_Blue is Rainbow;
subtype Int is Integer;
subtype Small_Int is Integer range -10 .. 10;
subtype Up_To_K is Column range 1 .. K; -- see 3.2.1
subtype Square is Matrix(1 .. 10, 1 .. 10); -- see 3.6
subtype Male is Person(Sex => M); -- see 3.10.1
subtype Binop_Ref is not null Binop_Ptr; -- see 3.10
3.2.3 Classification of Operations
Replace paragraph 1: [AI95-00416-01]
An operation operates on a type T if it yields a value of type T,
if it has an operand whose expected type (see 8.6) is T, or if it has an
access parameter (see 6.1) designating T. A predefined operator, or other
language-defined operation such as assignment or a membership test, that
operates on a type, is called a predefined operation of the type. The
primitive operations of a type are the predefined operations of the type,
plus any user-defined primitive subprograms.
by:
An operation operates on a type T if it yields a value of type T,
if it has an operand whose expected type (see 8.6) is T, or if it has an
access parameter or access result type (see 6.1) designating T. A
predefined operator, or other language-defined operation such as assignment or
a membership test, that operates on a type, is called a predefined
operation of the type. The primitive operations of a type are the
predefined operations of the type, plus any user-defined primitive subprograms.
Insert after paragraph 6: [AI95-00335-01]
-
For a specific type declared immediately within a
package_specification, any subprograms (in addition to the enumeration
literals) that are explicitly declared immediately within the same
package_specification and that operate on the type;
the new paragraph:
-
For a specific type, the stream-oriented attributes of the type that
are available (see 13.13.2) at the end of the list of declarative_items
where the type is declared;
Replace paragraph 7: [AI95-00200-01]
-
Any subprograms not covered above that are explicitly declared
immediately within the same declarative region as the type and that override
(see 8.3) other implicitly declared primitive subprograms of the type.
by:
-
In the case of a nonformal type, any subprograms not covered above
that are explicitly declared immediately within the same declarative region as
the type and that override (see 8.3) other implicitly declared primitive
subprograms of the type.
3.3 Objects and Named Numbers
Replace paragraph 10: [AI95-00416-01]
-
the result of evaluating
a function_call (or the equivalent operator invocation — see 6.6);
by:
-
the return object created as the result of evaluating
a function_call (or the equivalent operator invocation — see 6.6);
3.3.1 Object Declarations
Replace paragraph 2: [AI95-00385-01; AI95-00406-01]
object_declaration ::=
defining_identifier_list : [aliased] [constant] subtype_indication [:= expression]
| defining_identifier_list : [aliased] [constant] array_type_definition [:= expression]
| single_task_declaration
| single_protected_declaration
by:
object_declaration ::=
defining_identifier_list : [aliased] [constant] subtype_indication [:= expression]
| defining_identifier_list : [aliased] [constant] access_definition [:= expression]
| defining_identifier_list : [aliased] [constant] array_type_definition [:= expression]
| single_task_declaration
| single_protected_declaration
Replace paragraph 5: [AI95-00287-01]
An object_declaration without the reserved word constant declares a
variable object. If it has a subtype_indication or an
array_type_definition that defines an indefinite subtype, then there shall
be an initialization expression. An initialization expression shall not be
given if the object is of a limited type.
by:
An object_declaration without the reserved word constant declares a
variable object. If it has a subtype_indication or an
array_type_definition that defines an indefinite subtype, then there shall
be an initialization expression.
Replace paragraph 8: [AI95-00373-01; AI95-00385-01]
The subtype_indication or full type definition of an
object_declaration defines the nominal subtype of the object.
The object_declaration declares an object of the type of the nominal subtype.
by:
The subtype_indication, access_definition, or full type
definition of an object_declaration defines the nominal subtype
of the object.
The object_declaration declares an object of the type of the nominal subtype.
A component of an object is said to require late initialization
if it has an access discriminant value constrained by a per-object
expression, or if it has an initialization expression which includes a name
denoting the current instance of the type or denoting an access discriminant.
Replace paragraph 9: [AI95-00363-01]
If a composite object declared by an object_declaration has an
unconstrained nominal subtype, then if this subtype is indefinite or the object
is constant or aliased (see 3.10) the actual subtype of this object is
constrained. The constraint is determined by the bounds or discriminants (if
any) of its initial value; the object is said to be constrained by its
initial value. In the case of an aliased object, this initial value may be
either explicit or implicit; in the other cases, an explicit initial value is
required. When not constrained by its initial value, the actual and nominal
subtypes of the object are the same. If its actual subtype is constrained, the
object is called a constrained object.
by:
If a composite object declared by an object_declaration has an
unconstrained nominal subtype, then if this subtype is indefinite or the object
is constant the actual subtype of this object is constrained. The constraint is
determined by the bounds or discriminants (if any) of its initial value; the
object is said to be constrained by its initial value. When not constrained
by its initial value, the actual and nominal subtypes of the object are the
same. If its actual subtype is constrained, the object is called a
constrained object.
Replace paragraph 16: [AI95-00385-01]
- 1.
- The subtype_indication,
array_type_definition, single_task_declaration, or
single_protected_declaration is first elaborated.
This creates the nominal subtype (and the anonymous
type in the latter three cases).
by:
- 1.
- The subtype_indication, access_definition,
array_type_definition, single_task_declaration, or
single_protected_declaration is first elaborated.
This creates the nominal subtype (and the anonymous
type in the last four cases).
Replace paragraph 18: [AI95-00373-01]
- 3.
- The object is created, and, if there is not an initialization
expression, any per-object constraints (see 3.8) are elaborated and any
implicit initial values for the object or for its subcomponents are obtained
as determined by the nominal subtype.
by:
- 3.
- The object is created, and, if there is not an initialization
expression, the object is initialized by default. When an object is
initialized by default, any per-object constraints (see 3.8) are elaborated and
any implicit initial values for the object or for its subcomponents are
obtained as determined by the nominal subtype. Any initial values (whether
explicit or implicit) are assigned to the object or to the corresponding
subcomponents. As described in 5.2 and 7.6, Initialize and Adjust procedures
can be called.
Delete paragraph 19: [AI95-00373-01]
- 4.
- Any initial values (whether explicit or implicit) are assigned
to the object or to the corresponding subcomponents. As described in 5.2 and
7.6, Initialize and Adjust procedures can be called.
Replace paragraph 20: [AI95-00373-01]
For the third step above, the object creation and any elaborations and
evaluations are performed in an arbitrary order, except that if the
default_expression for a discriminant is evaluated to obtain its initial
value, then this evaluation is performed before that of the
default_expression for any component that depends on the discriminant, and
also before that of any default_expression that includes the name of the
discriminant. The evaluations of the third step and the assignments of the
fourth step are performed in an arbitrary order, except that each evaluation is
performed before the resulting value is assigned.
by:
For the third step above, evaluations and assignments are
performed in an arbitrary order subject to the following restrictions:
-
Assignment to any part of the object is preceded
by the evaluation of the value that is to be assigned.
-
The evaluation of a default_expression that includes the name of
a discriminant is preceded by the assignment to that discriminant.
-
The evaluation of the default_expression for any component that
depends on a discriminant is preceded by the assignment to that
discriminant.
-
The assignments to any components, including implicit components,
not requiring late initialization must precede the initial value
evaluations for any components requiring late initialization; if two
components both require late initialization, then assignments to parts
of the component occurring earlier in the order of the component
declarations must precede the initial value evaluations of the
component occurring later.
Replace paragraph 27: [AI95-00433-01]
John, Paul : Person_Name := new Person(Sex => M); -- see 3.10.1
by:
John, Paul : not null Person_Name := new Person(Sex => M); -- see 3.10.1
Replace paragraph 29: [AI95-00433-01]
John : Person_Name := new Person(Sex => M);
Paul : Person_Name := new Person(Sex => M);
by:
John : not null Person_Name := new Person(Sex => M);
Paul : not null Person_Name := new Person(Sex => M);
Replace paragraph 31: [AI95-00433-01]
Count, Sum : Integer;
Size : Integer range 0 .. 10_000 := 0;
Sorted : Boolean := False;
Color_Table : array(1 .. Max) of Color;
Option : Bit_Vector(1 .. 10) := (others => True);
Hello : constant String := "Hi, world.";
by:
Count, Sum : Integer;
Size : Integer range 0 .. 10_000 := 0;
Sorted : Boolean := False;
Color_Table : array(1 .. Max) of Color;
Option : Bit_Vector(1 .. 10) := (others => True);
Hello : aliased String := "Hi, world.";
θ, φ : Float range -π .. +π;
Replace paragraph 33: [AI95-00433-01]
Limit : constant Integer := 10_000;
Low_Limit : constant Integer := Limit/10;
Tolerance : constant Real := Dispersion(1.15);
by:
Limit : constant Integer := 10_000;
Low_Limit : constant Integer := Limit/10;
Tolerance : constant Real := Dispersion(1.15);
Hello_Msg : constant access String := Hello'Access; -- see 3.10.2
3.4 Derived Types and Classes
Replace paragraph 1: [AI95-00401-01; AI95-00419-01]
A derived_type_definition defines a new type (and its first subtype) whose
characteristics are derived from those of a parent type.
by:
A derived_type_definition defines a derived type (and its
first subtype) whose characteristics are derived from those of a
parent type, and possibly from progenitor types.
Replace paragraph 2: [AI95-00251-01; AI95-00419-01]
derived_type_definition ::= [abstract] new parent_subtype_indication [record_extension_part]
by:
derived_type_definition ::=
[abstract] [limited] new parent_subtype_indication [[and interface_list] record_extension_part]
Replace paragraph 3: [AI95-00251-01; AI95-00401-01; AI95-00419-01]
The parent_subtype_indication defines the parent subtype; its
type is the parent type.
by:
The parent_subtype_indication defines the parent subtype; its type
is the parent type. The interface_list defines the progenitor types
(see 3.9.4). A derived type has one parent type and zero or more progenitor
types.
Replace paragraph 5: [AI95-00401-01; AI95-00419-01]
If there is a record_extension_part, the derived type is called a
record extension of the parent type. A record_extension_part shall be
provided if and only if the parent type is a tagged type.
by:
If there is a record_extension_part, the derived type is called a
record extension of the parent type. A record_extension_part
shall be provided if and only if the parent type is a
tagged type. An interface_list shall be provided only if the parent type
is a tagged type.
If the reserved word limited appears in a derived_type_definition, the
parent type shall be a limited type.
Insert after paragraph 6: [AI95-00231-01]
The first subtype of the derived type is unconstrained if a
known_discriminant_part is provided in the declaration of the derived type, or
if the parent subtype is unconstrained. Otherwise,
the constraint of the first subtype corresponds to that of the parent
subtype in the following sense: it is the same as that of the parent subtype
except that for a range constraint (implicit or explicit), the value of each
bound of its range is replaced by the corresponding value of the derived type.
the new paragraph:
The first subtype of the derived type excludes null (see 3.10) if and
only if the parent subtype excludes null.
Replace paragraph 8: [AI95-00251-01; AI95-00401-01]
-
Each class of types that includes the parent type also includes the
derived type.
by:
-
Each class of types that includes the parent type or a progenitor type
also includes the derived type.
Delete paragraph 15: [AI95-00419-01]
-
The derived type is limited if and only if the parent type is limited.
Replace paragraph 17: [AI95-00401-01]
-
For each user-defined primitive subprogram (other than a user-defined
equality operator — see below) of the parent type that already exists at the
place of the derived_type_definition, there exists a corresponding
inherited primitive subprogram of the derived type with the same defining
name. Primitive user-defined equality operators of the parent type are also
inherited by the derived type, except when the derived type is a nonlimited
record extension, and the inherited operator would have a profile that is type
conformant with the profile of the corresponding predefined equality operator;
in this case, the user-defined equality operator is not inherited, but is
rather incorporated into the implementation of the predefined equality operator
of the record extension (see 4.5.2).
by:
-
For each user-defined primitive subprogram (other than a user-defined
equality operator — see below) of the parent type or of a progenitor type that
already exists at the place of the derived_type_definition, there exists a
corresponding inherited primitive subprogram of the derived type with the
same defining name. Primitive user-defined equality operators of the parent
type and any progenitor types are also inherited by the derived type, except
when the derived type is a nonlimited record extension, and the inherited
operator would have a profile that is type conformant with the profile of the
corresponding predefined equality operator; in this case, the user-defined
equality operator is not inherited, but is rather incorporated into the
implementation of the predefined equality operator of the record extension (see
4.5.2).
Replace paragraph 18: [AI95-00401-01]
The profile of an inherited subprogram (including an inherited enumeration
literal) is obtained from the profile of the corresponding (user-defined)
primitive subprogram of the parent type, after systematic replacement of each
subtype of its profile (see 6.1) that is of the parent type with a
corresponding subtype of the derived type. For a given subtype of the
parent type, the corresponding subtype of the derived type is defined as
follows:
by:
The profile of an inherited subprogram (including an inherited enumeration
literal) is obtained from the profile of the corresponding (user-defined)
primitive subprogram of the parent or progenitor type, after systematic
replacement of each subtype of its profile (see 6.1) that is of the parent or
progenitor type with a corresponding subtype of the derived type. For a
given subtype of the parent or progenitor type, the corresponding subtype of
the derived type is defined as follows:
Replace paragraph 22: [AI95-00401-01]
The same formal parameters have default_expressions in the profile of the
inherited subprogram. Any type mismatch due to the systematic replacement of
the parent type by the derived type is handled as part of the normal type
conversion associated with parameter passing — see 6.4.1.
by:
The same formal parameters have default_expressions in the profile of the
inherited subprogram. Any type mismatch due to the systematic replacement of
the parent or progenitor type by the derived type is handled as part of the
normal type conversion associated with parameter passing — see 6.4.1.
Replace paragraph 23: [AI95-00251-01; AI95-00401-01]
If a primitive subprogram of the parent type is visible at the place of the
derived_type_definition, then the corresponding inherited subprogram is
implicitly declared immediately after the derived_type_definition.
Otherwise, the inherited subprogram is implicitly declared later or not at all,
as explained in 7.3.1.
by:
If a primitive subprogram of the parent or progenitor type is visible at the
place of the derived_type_definition, then the corresponding inherited
subprogram is implicitly declared immediately after the
derived_type_definition. Otherwise, the inherited subprogram is implicitly
declared later or not at all, as explained in 7.3.1.
Replace paragraph 27: [AI95-00391-01; AI95-00401-01]
For the execution of a call on an inherited subprogram, a call on the
corresponding primitive subprogram of the parent type is performed; the normal
conversion of each actual parameter to the subtype of the corresponding formal
parameter (see 6.4.1) performs any necessary type conversion as well. If the
result type of the inherited subprogram is the derived type, the result of
calling the parent's subprogram is converted to the derived type.
by:
For the execution of a call on an inherited subprogram, a call on the
corresponding primitive subprogram of the parent or progenitor type is
performed; the normal conversion of each actual parameter to the subtype of the
corresponding formal parameter (see 6.4.1) performs any necessary type
conversion as well. If the result type of the inherited subprogram is the
derived type, the result of calling the subprogram of the parent or progenitor
is converted to the derived type, or in the case of a null extension, extended
to the derived type using the equivalent of an extension_aggregate with
the original result as the ancestor_part and null record as the
record_component_association_list.
Insert after paragraph 35: [AI95-00251-01; AI95-00345-01; AI95-00401-01]
17 If the reserved word abstract is given in the declaration
of a type, the type is abstract (see 3.9.3).
the new paragraphs:
18 An interface type which has a progenitor type "is derived
from" that type. A
derived_type_definition, however, never defines an interface type.
19 It is illegal for the parent type of a
derived_type_definition to be a synchronized tagged type.
3.4.1 Derivation Classes
Replace paragraph 2: [AI95-00251-01; AI95-00401-01]
A derived type is derived from its parent type directly; it is derived
indirectly from any type from which its parent type is derived. The
derivation class of types for a type T (also called the class rooted
at T) is the set consisting of T (the root type of the class) and
all types derived from T (directly or indirectly) plus any associated
universal or class-wide types (defined below).
by:
A derived type is derived from its parent type directly; it is derived
indirectly from any type from which its parent type is derived. A derived
type, interface type, type extension, task type, protected type, or formal
derived type is also derived from every ancestor of each of its progenitor
types, if any. The derivation class of types for a type T (also called the
class rooted at T) is the set consisting of T (the root type of
the class) and all types derived from T (directly or indirectly) plus any
associated universal or class-wide types (defined below).
Replace paragraph 6: [AI95-00230-01]
- Universal types
-
Universal types are defined for (and belong to) the integer, real, and fixed
point classes, and are referred to in this standard as respectively,
universal_integer, universal_real, and universal_fixed. These are
analogous to class-wide types for these language-defined numeric classes. As
with class-wide types, if a formal parameter is of a universal type, then an
actual parameter of any type in the corresponding class is acceptable. In
addition, a value of a universal type (including an integer or real
numeric_literal) is ``universal'' in that it is acceptable where some
particular type in the class is expected (see 8.6).
by:
- Universal types
-
Universal types are defined for (and belong to) the integer, real, fixed point,
and access classes, and are referred to in this standard as respectively,
universal_integer, universal_real, universal_fixed, and
universal_access. These are analogous to class-wide types for these
language-defined elementary classes. As with class-wide types, if a formal
parameter is of a universal type, then an actual parameter of any type in the
corresponding
class is acceptable. In addition, a value of a universal type (including an
integer or real numeric_literal, or the literal null) is ``universal''
in that it is acceptable where some particular type in the class is
expected (see 8.6).
Replace paragraph 10: [AI95-00230-01; AI95-00251-01]
A specific type T2 is defined to be a descendant of a type T1 if
T2 is the same as T1, or if T2 is derived (directly or indirectly)
from T1. A class-wide type T2'Class is defined to be a descendant of
type T1 if T2 is a descendant of T1. Similarly, the universal types
are defined to be descendants of the root types of their classes. If a type
T2 is a descendant of a type T1, then T1 is called an ancestor
of T2. The ultimate ancestor of a type is the ancestor of the type that
is not a descendant of any other type.
by:
A specific type T2 is defined to be a descendant of a type T1 if
T2 is the same as T1, or if T2 is derived (directly or indirectly)
from T1. A class-wide type T2'Class is defined to be a descendant of
type T1 if T2 is a descendant of T1. Similarly, the numeric
universal types are defined to be descendants of the root types of their
classes. If a type T2 is a descendant of a type T1, then T1 is
called an ancestor of T2. An ultimate ancestor of a type is an
ancestor of that type that is not itself a descendant of any other type. Every
untagged type has a unique ultimate ancestor.
3.5 Scalar Types
Insert after paragraph 27: [AI95-00285-01]
For an enumeration type, the function returns the value whose position
number is one less than that of the value of Arg; Constraint_Error is raised if
there is no such value of the type. For an integer type, the function returns
the result of subtracting one from the value of Arg. For a fixed point type,
the function returns the result of subtracting small from the value of Arg. For
a floating point type, the function returns the machine number (as defined in
3.5.7) immediately below the value of Arg; Constraint_Error is raised if there
is no such machine number.
the new paragraphs:
- S'Wide_Wide_Image
-
S'Wide_Wide_Image denotes a function with the following specification:
function S'Wide_Wide_Image(Arg : S'Base)
return Wide_Wide_String
The function returns an image of the value of Arg, that is, a
sequence of characters representing the value in display form. The lower bound
of the result is one.
The image of an integer value is the corresponding decimal literal,
without underlines, leading zeros, exponent, or trailing spaces, but with a
single leading character that is either a minus sign or a space.
The image of an enumeration value is either the corresponding
identifier in upper case or the corresponding character literal (including the
two apostrophes); neither leading nor trailing spaces are included. For a
nongraphic character (a value of a character type that has no enumeration
literal associated with it), the result is a corresponding language-defined
name in upper case (for example, the image of the nongraphic character
identified as nul is "NUL" — the quotes are not part of the image).
The image of a floating point value is a decimal real literal best
approximating the value (rounded away from zero if halfway between) with a
single leading character that is either a minus sign or a space, a single digit
(that is nonzero unless the value is zero), a decimal point, S'Digits–1 (see
3.5.8) digits after the decimal point (but one if S'Digits is one), an upper
case E, the sign of the exponent (either + or –), and two or more digits (with
leading zeros if necessary) representing the exponent. If S'Signed_Zeros is
True, then the leading character is a minus sign for a negatively signed zero.
The image of a fixed point value is a decimal real literal best
approximating the value (rounded away from zero if halfway between) with a
single leading character that is either a minus sign or a space, one or more
digits before the decimal point (with no redundant leading zeros), a decimal
point, and S'Aft (see 3.5.10) digits after the decimal point.
Replace paragraph 30: [AI95-00285-01]
The function returns an image of the value of Arg, that is, a
sequence of characters representing the value in display form. The lower bound
of the result is one.
by:
The function returns an image of the value of Arg as a Wide_String.
The lower bound of the result is one. The image has the same sequence of
character as defined for S'Wide_Wide_Image if all the graphic characters are
defined in Wide_Character; otherwise the sequence of characters is
implementation defined (but no shorter than that of S'Wide_Wide_Image for the
same value of Arg).
Delete paragraph 31: [AI95-00285-01]
The image of an integer value is the corresponding decimal literal,
without underlines, leading zeros, exponent, or trailing spaces, but with a
single leading character that is either a minus sign or a space.
Delete paragraph 32: [AI95-00285-01]
The image of an enumeration value is either the corresponding
identifier in upper case or the corresponding character literal (including the
two apostrophes); neither leading nor trailing spaces are included. For a
nongraphic character (a value of a character type that has no enumeration
literal associated with it), the result is a corresponding language-defined or
implementation-defined name in upper case (for example, the image of the
nongraphic character identified as nul is "NUL" — the quotes are not part
of the image).
Delete paragraph 33: [AI95-00285-01]
The image of a floating point value is a decimal real literal best
approximating the value (rounded away from zero if halfway between) with a
single leading character that is either a minus sign or a space, a single digit
(that is nonzero unless the value is zero), a decimal point, S'Digits-1 (see
3.5.8) digits after the decimal point (but one if S'Digits is one), an upper
case E, the sign of the exponent (either + or –), and two or more digits
(with leading zeros if necessary) representing the exponent. If S'Signed_Zeros
is True, then the leading character is a minus sign for a negatively signed
zero.
Delete paragraph 34: [AI95-00285-01]
The image of a fixed point value is a decimal real literal best
approximating the value (rounded away from zero if halfway between) with a
single leading character that is either a minus sign or a space, one or more
digits before the decimal point (with no redundant leading zeros), a decimal
point, and S'Aft (see 3.5.10) digits after the decimal point.
Replace paragraph 37: [AI95-00285-01]
The function returns an image of the value of Arg as a String. The
lower bound of the result is one. The image has the same sequence of graphic
characters as that defined for S'Wide_Image if all the graphic characters are
defined in Character; otherwise the sequence of characters is implementation
defined (but no shorter than that of S'Wide_Image for the same value of Arg).
by:
The function returns an image of the value of Arg as a String. The
lower bound of the result is one. The image has the same sequence of graphic
characters as that defined for S'Wide_Wide_Image if all the graphic characters
are defined in Character; otherwise the sequence of characters is
implementation defined (but no shorter than that of S'Wide_Wide_Image for the
same value of Arg).
- S'Wide_Wide_Width
-
S'Wide_Wide_Width denotes the maximum length of a Wide_Wide_String returned by
S'Wide_Wide_Image over all values of the subtype S. It denotes zero for a
subtype that has a null range. Its type is universal_integer.
Insert after paragraph 39: [AI95-00285-01]
- S'Width
-
S'Width denotes the maximum length of a String returned by S'Image over all
values of the subtype S. It denotes zero for a subtype that has a null range.
Its type is universal_integer.
the new paragraphs:
- S'Wide_Wide_Value
-
S'Wide_Wide_Value denotes a function with the following specification:
function S'Wide_Wide_Value(Arg : Wide_Wide_String)
return S'Base
This function returns a value given an image of the value as a
Wide_Wide_String, ignoring any leading or trailing spaces.
For the evaluation of a call on S'Wide_Wide_Value for an enumeration subtype S,
if the sequence of characters of the parameter (ignoring leading and trailing
spaces) has the syntax of an enumeration literal and if it corresponds to a
literal of the type of S (or corresponds to the result of S'Wide_Wide_Image
for a nongraphic character of the type), the result is the corresponding
enumeration value; otherwise Constraint_Error is raised.
For the evaluation of a call on S'Wide_Wide_Value for an integer subtype S, if
the sequence of characters of the parameter (ignoring leading and trailing
spaces) has the syntax of an integer literal, with an optional leading sign
character (plus or minus for a signed type; only plus for a modular type), and
the corresponding numeric value belongs to the base range of the type of S,
then that value is the result; otherwise Constraint_Error is raised.
For the evaluation of a call on S'Wide_Wide_Value for a real subtype
S, if the sequence of characters of the parameter (ignoring leading and
trailing spaces) has the syntax of one of the following:
-
base#based_numeral.#[exponent]
-
base#.based_numeral#[exponent]
with an optional leading sign character (plus or minus), and if the
corresponding numeric value belongs to the base range of the type of S, then
that value is the result; otherwise Constraint_Error is raised. The sign of a
zero value is preserved (positive if none has been specified) if S'Signed_Zeros
is True.
Replace paragraph 43: [AI95-00285-01]
For the evaluation of a call on S'Wide_Value for an enumeration subtype S,
if the sequence of characters of the parameter (ignoring leading and trailing
spaces) has the syntax of an enumeration literal and if it corresponds to a
literal of the type of S (or corresponds to the result of S'Wide_Image
for a nongraphic character of the type), the result is the corresponding
enumeration value; otherwise Constraint_Error is raised.
by:
For the evaluation of a call on S'Wide_Value for an enumeration subtype S,
if the sequence of characters of the parameter (ignoring leading and trailing
spaces) has the syntax of an enumeration literal and if it corresponds to a
literal of the type of S (or corresponds to the result of S'Wide_Image
for a value of the type), the result is the corresponding
enumeration value; otherwise Constraint_Error is raised. For a numeric subtype
S, the evaluation of a call on S'Wide_Value with Arg of type Wide_String is
equivalent to a call on S'Wide_Wide_Value for a corresponding Arg of type
Wide_Wide_String.
Delete paragraph 44: [AI95-00285-01]
For the evaluation of a call on S'Wide_Value (or S'Value) for an integer
subtype S, if the sequence of characters of the parameter (ignoring leading and
trailing spaces) has the syntax of an integer literal, with an optional leading
sign character (plus or minus for a signed type; only plus for a modular type),
and the corresponding numeric value belongs to the base range of the type of S,
then that value is the result; otherwise Constraint_Error is raised.
Delete paragraph 45: [AI95-00285-01]
For the evaluation of a call on S'Wide_Value (or S'Value) for a real
subtype S, if the sequence of characters of the parameter (ignoring leading and
trailing spaces) has the syntax of one of the following:
Delete paragraph 46: [AI95-00285-01]
Delete paragraph 47: [AI95-00285-01]
Delete paragraph 48: [AI95-00285-01]
Delete paragraph 49: [AI95-00285-01]
-
base#based_numeral.#[exponent]
Delete paragraph 50: [AI95-00285-01]
-
base#.based_numeral#[exponent]
Delete paragraph 51: [AI95-00285-01]
with an optional leading sign character (plus or minus), and if the
corresponding numeric value belongs to the base range of the type of S, then
that value is the result; otherwise Constraint_Error is raised. The sign of a
zero value is preserved (positive if none has been specified) if S'Signed_Zeros
is True.
Replace paragraph 55: [AI95-00285-01]
For the evaluation of a call on S'Value for an enumeration subtype S,
if the sequence of characters of the parameter (ignoring leading and trailing
spaces) has the syntax of an enumeration literal and if it corresponds to a
literal of the type of S (or corresponds to the result of S'Image for a value
of the type), the result is the corresponding enumeration value; otherwise
Constraint_Error is raised. For a numeric subtype S, the evaluation of a call
on S'Value with Arg of type String is equivalent to a call on S'Wide_Value for
a corresponding Arg of type Wide_String.
by:
For the evaluation of a call on S'Value for an enumeration subtype S,
if the sequence of characters of the parameter (ignoring leading and trailing
spaces) has the syntax of an enumeration literal and if it corresponds to a
literal of the type of S (or corresponds to the result of S'Image for a value
of the type), the result is the corresponding enumeration value; otherwise
Constraint_Error is raised. For a numeric subtype S, the evaluation of a call
on S'Value with Arg of type String is equivalent to a call on S'Wide_Wide_Value
for a corresponding Arg of type Wide_Wide_String.
Replace paragraph 56: [AI95-00285-01]
An implementation may extend the Wide_Value, Value, Wide_Image, and Image
attributes of a floating point type to support special values such as
infinities and NaNs.
by:
An implementation may extend the Wide_Wide_Value, Wide_Value, Value,
Wide_Wide_Image, Wide_Image, and Image attributes of a floating point type to
support special values such as infinities and NaNs.
Replace paragraph 59: [AI95-00285-01]
21 For any value V (including any nongraphic character) of an
enumeration subtype S, S'Value(S'Image(V)) equals V, as does
S'Wide_Value(S'Wide_Image(V)). Neither expression ever raises
Constraint_Error.
by:
21 For any value V (including any nongraphic character) of an
enumeration subtype S, S'Value(S'Image(V)) equals V, as do
S'Wide_Value(S'Wide_Image(V)) and S'Wide_Wide_Value(S'Wide_Wide_Image(V)).
None of these expressions ever raise Constraint_Error.
3.5.2 Character Types
Replace paragraph 2: [AI95-00285-01]
The predefined type Character is a character type whose values correspond to
the 256 code positions of Row 00 (also known as Latin-1) of the ISO 10646 Basic
Multilingual Plane (BMP). Each of the graphic characters of Row 00 of the BMP
has a corresponding character_literal in Character. Each of the nongraphic
positions of Row 00 (0000-001F and 007F-009F) has a corresponding
language-defined name, which is not usable as an enumeration literal, but which
is usable with the attributes (Wide_)Image and (Wide_)Value; these names are
given in the definition of type Character in A.1, ``The Package Standard'', but
are set in italics.
by:
The predefined type Character is a character type whose values correspond to
the 256 code positions of Row 00 (also known as Latin-1) of the ISO/IEC 10646:2003 Basic
Multilingual Plane (BMP). Each of the graphic characters of Row 00 of the BMP
has a corresponding character_literal in Character. Each of the nongraphic
positions of Row 00 (0000-001F and 007F-009F) has a corresponding
language-defined name, which is not usable as an enumeration literal, but which
is usable with the attributes Image, Wide_Image,
Wide_Wide_Image, Value, Wide_Value, and Wide_Wide_Value; these names are
given in the definition of type Character in A.1, ``The Package Standard'', but
are set in italics.
Replace paragraph 3: [AI95-00285-01; AI95-00395-01]
The predefined type Wide_Character is a character type whose values correspond
to the 65536 code positions of the ISO 10646 Basic Multilingual Plane (BMP).
Each of the graphic characters of the BMP has a corresponding character_literal
in Wide_Character. The first 256 values of Wide_Character have the same
character_literal or language-defined name as defined for Character. The last 2
values of Wide_Character correspond to the nongraphic positions FFFE and FFFF
of the BMP, and are assigned the language-defined names FFFE and FFFF. As with
the other language-defined names for nongraphic characters, the names FFFE and
FFFF are usable only with the attributes (Wide_)Image and (Wide_)Value; they
are not usable as enumeration literals. All other values of Wide_Character are
considered graphic characters, and have a corresponding character_literal.
by:
The predefined type Wide_Character is a character type whose values correspond
to the 65536 code positions of the ISO/IEC 10646:2003 Basic Multilingual Plane (BMP).
Each of the graphic characters of the BMP has a corresponding character_literal
in Wide_Character. The first 256 values of Wide_Character have the same
character_literal or language-defined name as defined for Character.
Each of the graphic_characters has a corresponding character_literal.
The predefined type Wide_Wide_Character is a character type whose values
correspond to the 2147483648 code positions of the ISO/IEC 10646:2003 character
set. Each of the graphic_characters has a corresponding character_literal
in Wide_Wide_Character. The first 65536 values of Wide_Wide_Character have the
same character_literal or language-defined name as defined for
Wide_Character.
The characters whose code position is larger than 16#FF# and which are not
graphic_characters have language-defined names which are formed by
appending to the string "Hex_" the representation of their code position in
hexadecimal as eight extended digits. As with other language-defined names,
these names are usable only with the attributes (Wide_)Wide_Image and
(Wide_)Wide_Value; they are not usable as enumeration literals.
Delete paragraph 4: [AI95-00285-01]
In a nonstandard mode, an implementation may provide other interpretations for
the predefined types Character and Wide_Character, to conform to local
conventions.
Delete paragraph 5: [AI95-00285-01]
If an implementation supports a mode with alternative interpretations for
Character and Wide_Character, the set of graphic characters of Character should
nevertheless remain a proper subset of the set of graphic characters of
Wide_Character. Any character set ``localizations'' should be reflected in the
results of the subprograms defined in the language-defined package
Characters.Handling (see A.3) available in such a mode. In a mode with an
alternative interpretation of Character, the implementation should also support
a corresponding change in what is a legal identifier_letter.
3.5.4 Integer Types
Replace paragraph 16: [AI95-00340-01]
For every modular subtype S, the following attribute is defined:
by:
For every modular subtype S, the following attributes are defined:
S'Mod denotes a function with the following specification:
function S'Mod (Arg : universal_integer)
return S'Base
This function returns Arg mod S'Modulus, as a value of the
type of S.
3.5.9 Fixed Point Types
Replace paragraph 8: [AI95-00100-01]
The set of values of a fixed point type comprise the integral multiples of a
number called the small of the type. For a type defined by an
ordinary_fixed_point_definition (an ordinary fixed point type), the
small may be specified by an attribute_definition_clause (see 13.3); if so
specified, it shall be no greater than the delta of the type. If not
specified, the small of an ordinary fixed point type is an
implementation-defined power of two less than or equal to the delta.
by:
The set of values of a fixed point type comprise the integral multiples of a
number called the small of the type. The machine numbers of a fixed
point type are the values of the type that can be represented exactly in every
unconstrained variable of the type. For a type defined by an
ordinary_fixed_point_definition (an ordinary fixed point type), the
small may be specified by an attribute_definition_clause (see 13.3);
if so specified, it shall be no greater than the delta of the type. If not
specified, the small of an ordinary fixed point type is an
implementation-defined power of two less than or equal to the delta.
3.6 Array Types
Replace paragraph 7: [AI95-00230-01; AI95-00406-01]
component_definition ::= [aliased] subtype_indication
by:
component_definition ::=
[aliased] subtype_indication
| [aliased] access_definition
Delete paragraph 11: [AI95-00363-01]
Within the definition of a nonlimited composite type (or a limited composite
type that later in its immediate scope becomes nonlimited -- see 7.3.1 and
7.5), if a component_definition contains the reserved word aliased and
the type of the component is discriminated, then the nominal subtype of the
component shall be constrained.
Replace paragraph 22: [AI95-00230-01]
The elaboration of a discrete_subtype_definition that does not contain
any per-object expressions creates the discrete
subtype, and consists of the elaboration of the subtype_indication or the
evaluation of the range. The elaboration of a
discrete_subtype_definition that contains one or more per-object
expressions is defined in 3.8. The elaboration of a component_definition
in an array_type_definition consists of the elaboration of the
subtype_indication. The elaboration of any
discrete_subtype_definitions and the elaboration of
the component_definition are performed in an arbitrary order.
by:
The elaboration of a discrete_subtype_definition that does not contain
any per-object expressions creates the discrete
subtype, and consists of the elaboration of the subtype_indication or the
evaluation of the range. The elaboration of a
discrete_subtype_definition that contains one or more per-object
expressions is defined in 3.8. The elaboration of a component_definition
in an array_type_definition consists of the elaboration of the
subtype_indication or access_definition. The elaboration of any
discrete_subtype_definitions and the elaboration of
the component_definition are performed in an arbitrary order.
Replace paragraph 30: [AI95-00433-01]
Grid : array(1 .. 80, 1 .. 100) of Boolean;
Mix : array(Color range Red .. Green) of Boolean;
Page : array(Positive range <>) of Line := -- an array of arrays
(1 | 50 => Line'(1 | Line'Last => '+', others => '-'), -- see 4.3.3
2 .. 49 => Line'(1 | Line'Last => '|', others => ' '));
-- Page is constrained by its initial value to (1..50)
by:
Grid : array(1 .. 80, 1 .. 100) of Boolean;
Mix : array(Color range Red .. Green) of Boolean;
Msg_Table : constant array(Error_Code) of access constant String :=
(Too_Big => new String'("Result too big"), Too_Small => ...);
Page : array(Positive range <>) of Line := -- an array of arrays
(1 | 50 => Line'(1 | Line'Last => '+', others => '-'), -- see 4.3.3
2 .. 49 => Line'(1 | Line'Last => '|', others => ' '));
-- Page is constrained by its initial value to (1..50)
3.6.2 Operations of Array Types
Replace paragraph 16: [AI95-00287-01]
48 A component of an array can be named with an indexed_component.
A value of an array type can be specified with an array_aggregate, unless
the array type is limited. For a one-dimensional array type, a slice of the array
can be named; also, string literals are defined if the component type is a
character type.
by:
48 A component of an array can be named with an indexed_component.
A value of an array type can be specified with an array_aggregate. For a
one-dimensional array type, a slice of the array can be named; also, string
literals are defined if the component type is a character type.
3.6.3 String Types
Replace paragraph 2: [AI95-00285-01]
There are two predefined string types, String and Wide_String, each indexed by
values of the predefined subtype Positive; these are declared in the visible
part of package Standard:
by:
There are three predefined string types, String, Wide_String, and
Wide_Wide_String, each indexed by values of the predefined subtype Positive;
these are declared in the visible part of package Standard:
Replace paragraph 4: [AI95-00285-01]
type String is array(Positive range <>) of Character;
type Wide_String is array(Positive range <>) of Wide_Character;
by:
type String is array(Positive range <>) of Character;
type Wide_String is array(Positive range <>) of Wide_Character;
type Wide_Wide_String is array(Positive range <>) of Wide_Wide_Character;
3.7 Discriminants
Replace paragraph 1: [AI95-00251-01; AI95-00326-01]
A composite type (other than an array type) can have discriminants, which
parameterize the type. A known_discriminant_part specifies the
discriminants of a composite type. A discriminant of an object is a component
of the object, and is either of a discrete type or an access type. An
unknown_discriminant_part in the declaration of a partial view of a type
specifies that the discriminants of the type are unknown for the given view;
all subtypes of such a partial view are indefinite subtypes.
by:
A composite type (other than an array or interface type) can have discriminants, which
parameterize the type. A known_discriminant_part specifies the
discriminants of a composite type. A discriminant of an object is a component
of the object, and is either of a discrete type or an access type. An
unknown_discriminant_part in the declaration of a view of a type
specifies that the discriminants of the type are unknown for the given view;
all subtypes of such a view are indefinite subtypes.
Replace paragraph 5: [AI95-00231-01]
discriminant_specification ::=
defining_identifier_list : subtype_mark [:= default_expression]
| defining_identifier_list : access_definition [:= default_expression]
by:
discriminant_specification ::=
defining_identifier_list : [null_exclusion] subtype_mark [:= default_expression]
| defining_identifier_list : access_definition [:= default_expression]
Replace paragraph 8: [AI95-00251-01]
A discriminant_part is only permitted in a declaration for a
composite type that is not an array type (this includes generic formal
types). A type declared with a known_discriminant_part is called a
discriminated type, as is a type that inherits (known) discriminants.
by:
A discriminant_part is only permitted in a declaration for a
composite type that is not an array or interface type (this includes generic
formal types). A type declared with a known_discriminant_part is called a
discriminated type, as is a type that inherits (known) discriminants.
Replace paragraph 9: [AI95-00231-01; AI95-00254-01]
The subtype of a discriminant may be defined by a subtype_mark, in which
case the subtype_mark shall denote a discrete or access subtype, or it may
be defined by an access_definition (in which case the subtype_mark of
the access_definition may denote any kind of subtype). A discriminant that
is defined by an access_definition is called an access discriminant and is
of an anonymous general access-to-variable type whose designated subtype is
denoted by the subtype_mark of the access_definition.
by:
The subtype of a discriminant may be defined by an optional null_exclusion
and a subtype_mark, in which case the subtype_mark shall denote a
discrete or access subtype, or it may be defined by an access_definition.
A discriminant that is defined by an access_definition is called an
access discriminant and is of an anonymous access type.
Replace paragraph 10: [AI95-00230-01; AI95-00402-01; AI95-00419-01]
A discriminant_specification for an access discriminant shall appear only
in the declaration for a task or protected type, or for a type with the
reserved word limited in its (full) definition or in that of one of its
ancestors. In addition to the places where Legality Rules normally apply (see
12.3), this rule applies also in the private part of an instance of a generic
unit.
by:
Default_expressions shall be provided either for all or for none of the
discriminants of a known_discriminant_part. No default_expressions
are permitted in a known_discriminant_part in a declaration of a tagged
type or a generic formal type.
A discriminant_specification for an access discriminant
may have a default_expression only in the declaration for a task or
protected type, or for a type that is a descendant of an explicitly limited
record type. In addition to the places where
Legality Rules normally apply (see 12.3), this rule applies also in the private
part of an instance of a generic unit.
Delete paragraph 11: [AI95-00402-01]
Default_expressions shall be provided either for all or for none of the
discriminants of a known_discriminant_part. No default_expressions are
permitted in a known_discriminant_part in a declaration of a tagged type
[or a generic formal type].
Replace paragraph 27: [AI95-00230-01; AI95-00416-01]
An access_definition is elaborated when the value of a corresponding
access discriminant is defined, either by evaluation of its
default_expression or by elaboration of a discriminant_constraint.
The elaboration of an access_definition creates the anonymous access
type. When the expression defining the access discriminant is evaluated, it is
converted to this anonymous access type (see 4.6).
by:
For an access discriminant, its access_definition is elaborated when
the value of the access discriminant is defined: by
evaluation of its default_expression, by elaboration of a
discriminant_constraint, or by an assignment that initializes the
enclosing object.
Replace paragraph 37: [AI95-00433-01]
type Item(Number : Positive) is
record
Content : Integer;
-- no component depends on the discriminant
end record;
by:
task type Worker(Prio : System.Priority; Buf : access Buffer) is
-- discriminants used to parameterize the task type (see 9.1)
pragma Priority(Prio); -- see D.1
entry Fill;
entry Drain;
end Worker;
3.7.1 Discriminant Constraints
Replace paragraph 7: [AI95-00363-01]
A discriminant_constraint is only allowed in a subtype_indication whose
subtype_mark denotes either an unconstrained discriminated subtype, or an
unconstrained access subtype whose designated subtype is an unconstrained
discriminated subtype. However, in the case of a general access subtype, a
discriminant_constraint is illegal if there is a place within the
immediate scope of the designated subtype where the designated subtype's view
is constrained.
by:
A discriminant_constraint is only allowed in a subtype_indication whose
subtype_mark denotes either an unconstrained discriminated subtype, or an
unconstrained access subtype whose designated subtype is an unconstrained
discriminated subtype. However, in the case of an access subtype, a
discriminant_constraint is illegal if the designated type has
a partial view that is constrained or, for a general access subtype, has
default_expressions for its discriminants. In addition to the places
where Legality Rules normally apply (see 12.3), these rules apply also in the
private part of an instance of a generic unit. In a generic body, this rule is
checked presuming all formal access types of the generic might be general
access types, and all untagged discriminated formal types of the generic might
have default_expressions for its discriminants.
3.8 Record Types
Delete paragraph 8: [AI95-00287-01]
A default_expression is not permitted if the component is of a limited
type.
Replace paragraph 9: [AI95-00366-01]
Each component_declaration declares a component of the record type.
Besides components declared by component_declarations, the components of a
record type include any components declared by discriminant_specifications
of the record type declaration. The identifiers of all components of a record
type shall be distinct.
by:
Each component_declaration declares a component of the record type.
Besides components declared by component_declarations, the components of a
record type include any components declared by discriminant_specifications
of the record type declaration. The identifiers of all components of a record
type shall be distinct.
Insert before paragraph 14: [AI95-00318-02]
The component_definition of a component_declaration defines the
(nominal) subtype of the component. If the reserved word aliased appears
in the component_definition, then the component is aliased (see 3.10).
the new paragraph:
If a record_type_declaration includes the reserved word limited, the
type is called an explicitly limited record type.
Replace paragraph 18: [AI95-00230-01]
Within the definition of a composite type, if a component_definition or
discrete_subtype_definition (see 9.5.2) includes a name that denotes
a discriminant of the type, or that is an attribute_reference whose
prefix denotes the current instance of the type, the expression containing the
name is called a per-object expression, and the constraint or
range being defined is called a per-object constraint. For the
elaboration of a component_definition of a component_declaration or
the discrete_subtype_definition of an entry_declaration for an entry
family (see 9.5.2), if the constraint or range of the
subtype_indication or discrete_subtype_definition is not a per-object
constraint, then the subtype_indication or discrete_subtype_definition
is elaborated. On the other hand, if the constraint or range is a
per-object constraint, then the elaboration consists of the evaluation of any
included expression that is not part of a per-object expression. Each such
expression is evaluated once unless it is part of a named association in a
discriminant constraint, in which case it is evaluated once for each associated
discriminant.
by:
Within the definition of a composite type, if a component_definition or
discrete_subtype_definition (see 9.5.2) includes a name that denotes
a discriminant of the type, or that is an attribute_reference whose
prefix denotes the current instance of the type, the expression containing the
name is called a per-object expression, and the constraint or
range being defined is called a per-object constraint. For the
elaboration of a component_definition of a component_declaration or
the discrete_subtype_definition of an entry_declaration for an entry
family (see 9.5.2), if the component subtype is defined by an
access_definition or if the constraint or range of the
subtype_indication or discrete_subtype_definition is not a per-object
constraint, then the access_definition, subtype_indication, or
discrete_subtype_definition is elaborated. On the other hand, if the
constraint or range is a per-object constraint, then the elaboration
consists of the evaluation of any included expression that is not part of a
per-object expression. Each such expression is evaluated once unless it is part
of a named association in a discriminant constraint, in which case it is
evaluated once for each associated discriminant.
Replace paragraph 25: [AI95-00287-01]
61 A component of a record can be named with a
selected_component. A value of a record can be specified with a
record_aggregate, unless the record type is limited.
by:
61 A component of a record can be named with a
selected_component. A value of a record can be specified with a
record_aggregate.
3.9 Tagged Types and Type Extensions
Replace paragraph 2: [AI95-00345-01]
A record type or private type that has the reserved word tagged in its
declaration is called a tagged type. When deriving from a tagged type,
additional components may be defined. As for any derived type, additional
primitive subprograms may be defined, and inherited primitive subprograms may
be overridden. The derived type is called an extension of the ancestor type,
or simply a type extension. Every type extension is also a tagged type,
and is either a record extension or a private extension of some other
tagged type. A record extension is defined by a derived_type_definition
with a record_extension_part. A private extension, which is a partial
view of a record extension, can be declared in the visible part of a package
(see 7.3) or in a generic formal part (see 12.5.1).
by:
A record type or private type that has the reserved word tagged in
its declaration is called a tagged type. In addition, an interface
type is a tagged type (see 3.9.4). When deriving from a tagged
type, as for any derived type, additional primitive subprograms may
be defined, and inherited primitive subprograms may be overridden.
The derived type is called an extension of its ancestor type(s), or
simply a type extension.
Every type extension is also a tagged type, and is either a record
extension of some other tagged type, a private extension, or a
task or protected type derived from an interface type (a synchronized tagged
type — see 3.9.4). A record extension is defined by a
derived_type_definition with a record_extension_part (see 3.9.1),
which may include the definition of additional components. A private
extension, which is a partial view of a record extension or of a
synchronized tagged type, can be declared in the visible part of a
package (see 7.3) or in a generic formal part (see 12.5.1).
Replace paragraph 4: [AI95-00344-01]
The tag of a specific tagged type identifies the full_type_declaration of
the type. If a declaration for a tagged type occurs within a
generic_package_declaration, then the corresponding type declarations in
distinct instances of the generic package are associated with distinct tags.
For a tagged type that is local to a generic package body, the language does
not specify whether repeated instantiations of the generic body result in
distinct tags.
by:
The tag of a specific tagged type identifies the full_type_declaration of
the type, and for a type extension, is sufficient to uniquely identify the type
among all descendants of the same ancestor. If a declaration for a tagged
type occurs within a generic_package_declaration, then the
corresponding type declarations in distinct instances of the generic
package are associated with distinct tags. For a tagged type that is local to a
generic package body and with all of its ancestors (if any) also local to the
generic body, the language does not specify whether repeated instantiations
of the generic body result in distinct tags.
Replace paragraph 6: [AI95-00260-02; AI95-00362-01]
package Ada.Tags is
type Tag is private;
by:
package Ada.Tags is
pragma Preelaborate(Tags);
type Tag is private;
No_Tag : constant Tag;
Insert after paragraph 7: [AI95-00260-02; AI95-00344-01; AI95-00405-01]
function Expanded_Name(T : Tag) return String;
function External_Tag(T : Tag) return String;
function Internal_Tag(External : String) return Tag;
the new paragraphs:
function Descendant_Tag(External : String; Ancestor : Tag) return Tag;
function Is_Descendant_At_Same_Level(Descendant, Ancestor : Tag)
return Boolean;
function Parent_Tag (T : Tag) return Tag;
type Tag_Array is array (Positive range <>) of Tag;
function Interface_Ancestor_Tags (T : Tag) return Tag_Array;
Insert after paragraph 9: [AI95-00260-02]
private
... -- not specified by the language
end Ada.Tags;
the new paragraph:
No_Tag is the default initial value of type Tag.
Replace paragraph 10: [AI95-00400-01]
The function Expanded_Name returns the full expanded name of the first subtype
of the specific type identified by the tag, in upper case, starting with a root
library unit. The result is implementation defined if the type is declared
within an unnamed block_statement.
by:
The function Wide_Wide_Expanded_Name returns the full expanded name of the
first subtype of the specific type identified by the tag, in upper case,
starting with a root library unit. The result is implementation defined if the
type is declared within an unnamed block_statement.
The function Expanded_Name (respectively, Wide_Expanded_Name) returns the same
sequence of graphic characters as that defined for Wide_Wide_Expanded_Name, if
all the graphic characters are defined in Character (respectively,
Wide_Character); otherwise, the sequence of characters is implementation
defined, but no shorter than that returned by Wide_Wide_Expanded_Name for the
same value of the argument.
Insert after paragraph 11: [AI95-00417-01]
The function External_Tag returns a string to be used in an external
representation for the given tag. The call External_Tag(S'Tag) is equivalent to
the attribute_reference S'External_Tag (see 13.3).
the new paragraph:
The string returned by the functions Expanded_Name, Wide_Expanded_Name,
Wide_Wide_Expanded_Name, and External_Tag has lower bound 1.
Replace paragraph 12: [AI95-00260-02; AI95-00279-01; AI95-00344-01; AI95-00405-01]
The function Internal_Tag returns the tag that corresponds to the given
external tag, or raises Tag_Error if the given string is not the external tag
for any specific type of the partition.
by:
The function Internal_Tag returns a tag that corresponds to the given
external tag, or raises Tag_Error if the given string is not the external tag
for any specific type of the partition. Tag_Error is also raised if the
specific type identified is a library-level type whose tag has not
yet been created (see 13.14).
The function Descendant_Tag returns the (internal) tag for the type
that corresponds to the given external tag and is both a descendant of the
type identified by the Ancestor tag and has the same accessibility level as
the identified ancestor. Tag_Error is raised if External is not the
external tag for such a type. Tag_Error is also raised if the
specific type identified is a library-level type whose tag has not
yet been created.
The function Is_Descendant_At_Same_Level returns True if Descendant tag
identifies a type that is both a descendant of the type identified
by Ancestor and at the same accessibility level. If not, it returns False.
The function Parent_Tag returns the tag of the parent type of the type whose
tag is T. If the type does not have a parent type (that is, it was not
declared by a derived_type_declaration), then No_Tag is returned.
The function Interface_Ancestor_Tags returns an array containing the tag of
each interface ancestor type of the type whose tag is T, other than T itself.
The lower bound of the returned array is 1, and the order of the returned tags
is unspecified. Each tag appears in the result exactly once. If the
type whose tag is T has no interface ancestors, a null array is returned.
Insert after paragraph 18: [AI95-00260-02]
- X'Tag
-
X'Tag denotes the tag of X. The value of this attribute is of type Tag.
the new paragraphs:
The following language-defined generic function exists:
generic
type T (<>) is abstract tagged limited private;
type Parameters (<>) is limited private;
with function Constructor (Params : access Parameters)
return T is abstract;
function Ada.Tags.Generic_Dispatching_Constructor
(The_Tag : Tag;
Params : access Parameters) return T'Class;
pragma Preelaborate (Generic_Dispatching_Constructor);
pragma Convention (Intrinsic, Generic_Dispatching_Constructor);
Tags.Generic_Dispatching_Constructor
provides a mechanism to create an object of an appropriate type from just a tag
value. The function Constructor is expected to create the object given a
reference to an object of type Parameters.
Replace paragraph 24: [AI95-00318-02]
-
The tag of the result returned by a function with a class-wide result
type is that of the return expression.
by:
-
The tag of the result returned by a function with a class-wide result
type is that of the return object.
Insert after paragraph 25: [AI95-00260-02; AI95-00344-01; AI95-00405-01]
The tag is preserved by type conversion and by parameter passing. The tag of a
value is the tag of the associated object (see 6.2).
the new paragraphs:
Tag_Error is raised by a call of Descendant_Tag, Expanded_Name, External_Tag,
Interface_Ancestor_Tag, Is_Descendant_At_Same_Level, or Parent_Tag if any tag
passed is No_Tag.
An instance of Tags.Generic_Dispatching_Constructor
raises Tag_Error if The_Tag does not represent a concrete descendant of T.
Otherwise, it dispatches to the primitive function denoted by the formal
Constructor for the type identified by the tag The_Tag, passing Params, and
returns the result. Any exception raised by the function is propagated.
If the internal tag provided to an instance of
Tags.Generic_Dispatching_Constructor identifies a specific type whose tag
has not been created (see 13.14), or does not exist in the partition at the
time of the call, execution is erroneous.
Replace paragraph 26: [AI95-00279-01]
The implementation of the functions in Ada.Tags may raise Tag_Error if no
specific type corresponding to the tag passed as a parameter exists in the
partition at the time the function is called.
by:
The implementation of the functions in Ada.Tags may raise Tag_Error if no
specific type corresponding to the tag or external tag passed as a parameter
exists in the partition at the time the function is called.
Replace paragraph 30: [AI95-00260-02; AI95-00326-01]
65 If S denotes an untagged private type whose full type is
tagged, then S'Class is also allowed before the full type definition, but only
in the private part of the package in which the type is declared (see 7.3.1).
Similarly, the Class attribute is defined for incomplete types whose full type
is tagged, but only within the library unit in which the incomplete type is
declared (see 3.10.1).
by:
65 The capability provided by
Tags.Generic_Dispatching_Constructor is sometimes known as a
factory.
3.9.1 Type Extensions
Replace paragraph 3: [AI95-00344-01; AI95-00345-01; AI95-00419-01]
The parent type of a record extension shall not be a class-wide type. If the
parent type is nonlimited, then each of the components of the
record_extension_part shall be nonlimited. The accessibility level (see
3.10.2) of a record extension shall not be statically deeper than that of its
parent type. In addition to the places where Legality Rules normally apply (see
12.3), these rules apply also in the private part of an instance of a generic
unit.
by:
The parent type of a record extension shall not be a class-wide type nor
shall it be a synchronized tagged type (see 3.9.4). If the
record extension is nonlimited, then each of the components of the
record_extension_part shall be nonlimited. In addition to the places
where Legality Rules normally apply (see 12.3), these rules apply also in the
private part of an instance of a generic unit.
Replace paragraph 4: [AI95-00344-01; AI95-00391-01]
A type extension shall not be declared in a generic body if the parent type is
declared outside that body.
by:
Within the body of a generic unit, or the body of any of its descendant
library units, a tagged type shall not be declared as a descendant
of a formal type declared within the formal part of the generic unit.
A record extension is a null extension if its declaration
has no known_discriminant_part and its record_extension_part
includes no component_declarations.
Replace paragraph 7: [AI95-00344-01]
The accessibility rules imply that a tagged type declared in a
library package_specification can be extended only at library level or as
a generic formal. When the extension is declared immediately within a
package_body, primitive subprograms are inherited and are overridable,
but new primitive subprograms cannot be added.
by:
When an extension is declared immediately within a
body, primitive subprograms are inherited and are overridable,
but new primitive subprograms cannot be added.
3.9.2 Dispatching Operations of Tagged Types
Replace paragraph 1: [AI95-00260-02]
The primitive subprograms of a tagged type are called dispatching
operations. A dispatching operation can be called using a statically
determined controlling tag, in which case the body to be executed is
determined at compile time. Alternatively, the controlling tag can be
dynamically determined, in which case the call dispatches to a body that is
determined at run time; such a call is termed a dispatching call. As
explained below, the properties of the operands and the context of a particular
call on a dispatching operation determine how the controlling tag is
determined, and hence whether or not the call is a dispatching call. Run-time
polymorphism is achieved when a dispatching operation is called by a
dispatching call.
by:
The primitive subprograms of a tagged type and the subprograms declared by
formal_abstract_subprogram_declarations are called dispatching
operations. A dispatching operation can be called using a statically
determined controlling tag, in which case the body to be executed is
determined at compile time. Alternatively, the controlling tag can be
dynamically determined, in which case the call dispatches to a body that is
determined at run time; such a call is termed a dispatching call. As
explained below, the properties of the operands and the context of a particular
call on a dispatching operation determine how the controlling tag is
determined, and hence whether or not the call is a dispatching call. Run-time
polymorphism is achieved when a dispatching operation is called by a
dispatching call.
Replace paragraph 2: [AI95-00260-02; AI95-00416-01]
A call on a dispatching operation is a call whose name or prefix
denotes the declaration of a primitive subprogram of a tagged type, that is, a
dispatching operation. A controlling operand in a call on a dispatching
operation of a tagged type T is one whose corresponding formal parameter is
of type T or is of an anonymous access type with designated type T; the
corresponding formal parameter is called a controlling formal parameter. If
the controlling formal parameter is an access parameter, the controlling
operand is the object designated by the actual parameter, rather than the
actual parameter itself. If the call is to a (primitive) function with result
type T, then the call has a controlling result — the context of the
call can control the dispatching.
by:
A call on a dispatching operation is a call whose name or prefix
denotes the declaration of a dispatching operation. A controlling operand
in a call on a dispatching operation of a tagged type T is one whose
corresponding formal parameter is of type T or is of an anonymous access
type with designated type T; the corresponding formal parameter is called a
controlling formal parameter. If the controlling formal parameter is an
access parameter, the controlling operand is the object designated by the
actual parameter, rather than the actual parameter itself. If the call is to a
(primitive) function with result type T, then the call has a controlling
result — the context of the call can control the dispatching. Similarly, if
the call is to a function with access result type designating T, then the
call has a controlling access result, and the context can similarly control
dispatching.
Replace paragraph 4: [AI95-00416-01]
-
The name or expression is statically tagged if it is of a
specific tagged type and, if it is a call with a controlling result, it has at
least one statically tagged controlling operand;
by:
-
The name or expression is statically tagged if it is of a
specific tagged type and, if it is a call with a controlling result or
controlling access result, it has at least one statically tagged controlling
operand;
Replace paragraph 5: [AI95-00416-01]
-
The name or expression is dynamically tagged if it is of a
class-wide type, or it is a call with a controlling result and at least one
dynamically tagged controlling operand;
by:
-
The name or expression is dynamically tagged if it is of a
class-wide type, or it is a call with a controlling result or controlling
access result and at least one dynamically tagged controlling operand;
Replace paragraph 6: [AI95-00416-01]
-
The name or expression is tag indeterminate if it is a call
with a controlling result, all of whose controlling operands (if any) are tag
indeterminate.
by:
-
The name or expression is tag indeterminate if it is a call
with a controlling result or controlling access result, all of whose
controlling operands (if any) are tag indeterminate.
Replace paragraph 10: [AI95-00430-01]
In the declaration of a dispatching operation of a tagged type, everywhere a
subtype of the tagged type appears as a subtype of the profile (see 6.1), it
shall statically match the first subtype of the tagged type. If the
dispatching operation overrides an inherited subprogram, it shall be subtype
conformant with the inherited subprogram. The convention of an inherited or
overriding dispatching operation is the convention of the corresponding
primitive operation of the parent type. An explicitly declared dispatching
operation shall not be of convention Intrinsic.
by:
In the declaration of a dispatching operation of a tagged type, everywhere a
subtype of the tagged type appears as a subtype of the profile (see 6.1), it
shall statically match the first subtype of the tagged type. If the
dispatching operation overrides an inherited subprogram, it shall be subtype
conformant with the inherited subprogram.
The convention of an inherited dispatching operation is the convention of the
corresponding primitive operation of the parent or progenitor type. The default
convention of a dispatching operation that overrides an inherited primitive
operation is the convention of the inherited operation; if the operation
overrides multiple inherited operations, then they shall all have the same
convention. An explicitly declared dispatching
operation shall not be of convention Intrinsic.
Replace paragraph 11: [AI95-00404-01; AI95-00416-01]
The default_expression for a controlling formal parameter of a dispatching
operation shall be tag indeterminate. A controlling formal parameter that is an
access parameter shall not have a default_expression.
by:
The default_expression for a controlling formal parameter of a dispatching
operation shall be tag indeterminate.
Replace paragraph 17: [AI95-00196-01]
If all of the controlling operands are tag-indeterminate, then:
by:
If all of the controlling operands (if any) are tag-indeterminate, then:
Replace paragraph 18: [AI95-00196-01; AI95-00239-01]
-
If the call has a controlling result and is itself a (possibly
parenthesized or qualified) controlling operand of an enclosing call on a
dispatching operation of type T, then its controlling tag value is
determined by the controlling tag value of this enclosing call;
by:
-
If the call has a controlling result or controlling access result and
is itself, or designates, a (possibly parenthesized or qualified) controlling
operand of an enclosing call on a dispatching operation of a descendant of type
T, then its controlling tag value is determined by the controlling tag
value of this enclosing call;
-
If the call has a controlling result or controlling access result and
(possibly parenthesized, qualified, or dereferenced) is the expression of an
assignment_statement whose target is of a class-wide type, then
its controlling tag value is determined by the target;
Replace paragraph 20: [AI95-00345-01]
For the execution of a call on a dispatching operation, the body executed
is the one for the corresponding primitive subprogram of the specific type
identified by the controlling tag value. The body for an explicitly
declared dispatching operation is the corresponding explicit body for the
subprogram. The body for an implicitly declared dispatching operation that
is overridden is the body for the overriding subprogram, even if
the overriding occurs in a private part. The body for an inherited dispatching
operation that is not overridden is the body of the
corresponding subprogram of the parent or ancestor type.
by:
For the execution of a call on a dispatching operation, the body executed
is the one for the corresponding primitive subprogram of the specific type
identified by the controlling tag value. The body for an explicitly
declared dispatching operation is the corresponding explicit body for the
subprogram. The body for an implicitly declared dispatching operation that
is overridden is the body for the overriding subprogram, even if
the overriding occurs in a private part. Similarly, the body for an
implicitly declared dispatching operation that is implemented by an
entry (see 9.1) or protected operation (see 9.4) is the body for the
implemented entry or operation. The body for an inherited dispatching
operation that is not overridden or implemented is the body of the
corresponding subprogram of the parent or ancestor type.
Replace paragraph 22: [AI95-00260-02]
73 This subclause covers calls on primitive subprograms of
a tagged type. Rules for tagged type membership tests are described
in 4.5.2. Controlling tag determination for an assignment_statement
is described in 5.2.
by:
73 This subclause covers calls on dispatching subprograms of
a tagged type. Rules for tagged type membership tests are described
in 4.5.2. Controlling tag determination for an assignment_statement
is described in 5.2.
3.9.3 Abstract Types and Subprograms
Replace paragraph 1: [AI95-00345-01; AI95-00348-01]
An abstract type is a tagged type intended for use as a parent type for
type extensions, but which is not allowed to have objects of its own. An
abstract subprogram is a subprogram that has no body, but is intended to be
overridden at some point when inherited. Because objects of an abstract type
cannot be created, a dispatching call to an abstract subprogram always
dispatches to some overriding body.
by:
An abstract type is a tagged type intended for use as an ancestor of other
types, but which is not allowed to have objects of its own. An abstract
subprogram is a subprogram that has no body, but is intended to be overridden
at some point when inherited. Because objects of an abstract type cannot be
created, a dispatching call to an abstract subprogram always dispatches to some
overriding body.
abstract_subprogram_declaration ::=
[overriding_indicator]
subprogram_specification is abstract;
Interface types (see 3.9.4) are abstract types. In addition, a
tagged type that has the reserved word abstract in its declaration
is an abstract type. The class-wide type (see 3.4.1) rooted at an
abstract type is not itself an abstract type.
Replace paragraph 2: [AI95-00345-01]
An abstract type is a specific type that has the reserved word abstract in
its declaration. Only a tagged type is allowed to be declared abstract.
by:
Only a tagged type shall have the reserved word abstract in its
declaration.
Replace paragraph 3: [AI95-00260-01; AI95-00348-01]
A subprogram declared by an abstract_subprogram_declaration (see 6.1)
is an abstract subprogram. If it is a primitive subprogram of a tagged
type, then the tagged type shall be abstract.
by:
A subprogram declared by an abstract_subprogram_declaration or
declared by a formal_abstract_subprogram_declaration (see 12.6)
is an abstract subprogram. If it is a primitive subprogram of a tagged type,
then the tagged type shall be abstract.
Replace paragraph 4: [AI95-00251-01; AI95-00334-01]
For a derived type, if the parent or ancestor type has an abstract primitive
subprogram, or a primitive function with a controlling result, then:
by:
If a type has an implicitly declared primitive subprogram that is
inherited or is the predefined equality operator, and the corresponding
primitive subprogram of the parent or ancestor type is abstract or is a
function with a controlling access result, or if a type
other than a null extension inherits a
function with a controlling result, then:
Replace paragraph 5: [AI95-00251-01; AI95-00334-01]
-
If the derived type is abstract or untagged, the inherited subprogram
is abstract.
by:
-
If the type is abstract or untagged, the implicitly declared
subprogram is abstract.
Replace paragraph 6: [AI95-00391-01]
Otherwise, the subprogram shall be overridden with a nonabstract subprogram;
for a type declared in the visible part of a package, the overriding may be
either in the visible or the private part. However, if the type is a generic
formal type, the subprogram need not be overridden for the formal type itself;
a nonabstract version will necessarily be provided by the actual type.
by:
Otherwise, the subprogram shall be overridden with a nonabstract subprogram or,
in the case of a private extension inheriting a function with a controlling
result, have a full type that is a null extension; for a type declared in the
visible part of a package, the overriding may be either in the visible or the
private part. However, if the type is a generic formal type, the subprogram
need not be overridden for the formal type itself; a nonabstract version will
necessarily be provided by the actual type.
Replace paragraph 11: [AI95-00260-01; AI95-00348-01]
A generic actual subprogram shall not be an abstract subprogram.
The prefix of an attribute_reference for the Access,
Unchecked_Access, or Address attributes shall not denote an abstract
subprogram.
by:
A generic actual subprogram shall not be an abstract subprogram unless the
generic formal subprogram is declared by a
formal_abstract_subprogram_declaration.
The prefix of an attribute_reference for the Access,
Unchecked_Access, or Address attributes shall not denote an abstract
subprogram.
The elaboration of an abstract_subprogram_declaration has no effect.
3.9.4 Interface Types
Insert new clause: [AI95-00251-01; AI95-00345-01; AI95-00419-01; AI95-00433-01]
An interface type is an abstract tagged type that provides a restricted
form of multiple inheritance. A tagged type, task type, or protected type
may have one or more interface types as ancestors.
interface_type_definition ::=
[limited | task | protected | synchronized] interface [and interface_list]
interface_list ::= interface_subtype_mark {and interface_subtype_mark}
An interface type (also called an interface) is a specific abstract
tagged type that is defined by an interface_type_definition.
An interface with the reserved word limited, task, protected, or
synchronized in its definition is termed, respectively, a limited
interface, a task interface, a protected interface, or a
synchronized interface. In addition, all task and protected interfaces
are synchronized interfaces, and all synchronized interfaces are limited
interfaces. A view of an object that is of a task interface type (or of a
corresponding class-wide type) is a task object. Similarly, a view of an
object that is of a protected interface type (or of a corresponding
class-wide type) is a protected object.
A task or protected type derived from an interface is a tagged type. Such
a tagged type is called a synchronized tagged type, as are synchronized
interfaces and private extensions derived from synchronized interfaces.
An interface type has no components.
An interface_subtype_mark in an interface_list names a
progenitor subtype; its type is the progenitor type.
An interface type inherits user-defined primitive subprograms from each
progenitor type in the same way that a derived type inherits user-defined
primitive subprograms from its progenitor types (see 3.4).
All user-defined primitive subprograms of an interface type shall be
abstract subprograms or null procedures.
The type of a subtype named in an interface_list shall be an
interface type.
A descendant of a nonlimited interface shall be nonlimited. A descendant
of a task interface shall be a task type or a task interface. A descendant
of a protected interface shall be a protected type or a protected
interface. A descendant of a synchronized interface shall be a task type,
a protected type, or a synchronized interface.
For an interface type declared in a visible part, a primitive
subprogram shall not be declared in the private part.
In addition to the places where Legality Rules normally apply
(see 12.3), these rules apply also in the private part of an instance
of a generic unit.
The elaboration of an interface_type_definition has no effect.
NOTES
79 Nonlimited interface types have predefined nonabstract equality
operators. These may be overridden with user-defined abstract
equality operators. Such operators will then require
an explicit overriding for any nonabstract descendant of the interface.
Example of limited interface and synchronized interface extending it:
type Queue is limited interface;
procedure Append(Q : in out Queue; Element : in Person_Name) is abstract;
procedure Remove_First(Q : in out Queue; Element : out Person_Name) is abstract;
function Cur_Count(Q : in Queue) return Natural is abstract;
function Max_Count(Q : in Queue) return Natural is abstract;
-- See 3.10.1 for Person_Name.
Queue_Error : exception;
-- Append raises Queue_Error if Count(Q) = Max_Count(Q)
-- Remove_First raises Queue_Error if Count(Q) = 0
type Synchronized_Queue is synchronized interface and Queue; -- see 9.11
procedure Append_Wait(Q : in out Queue; Element : in Person_Name) is abstract;
procedure Remove_First_Wait(Q : in out Queue; Element : out Person_Name) is abstract;
...
procedure Transfer(From : in out Queue'Class;
To : in out Queue'Class;
Number : in Natural := 1) is
Element : Person_Name_Name;
begin
for I in 1..Number loop
Remove_First(From, Element);
Append(To, Element);
end loop;
end Transfer;
This defines a Queue interface defining a queue of people. (A similar
design could be created to define any kind of queue simply by replacing
Person_Name by an appropriate type.)
The Queue interface has four dispatching operations, Append,
Remove_First, Cur_Count, and Max_Count. The body of a class-wide
operation, Transfer is also shown. Every non-abstract extension
of Queue must provide implementations for at least its four
dispatching operations, as they are abstract. Any object of a type
derived from Queue may be passed to Transfer, as either the From
or the To operand. The two operands need not be of the same type
in any given call.
The Synchronized_Queue interface inherits the four dispatching
operations from Queue, and adds two additional dispatching
operations, which wait if necessary rather than raising the
Queue_Error exception. This synchronized interface may only
be implemented by a task or protected type, and as such
ensures safe concurrent access.
Example use of an interface:
type Fast_Food_Queue is new Queue with record ...;
procedure Append (Q : in out Fast_Food_Queue; Element : in Person_Name);
procedure Remove_First (Q : in out Fast_Food_Queue; Element : in Person_Name);
function Cur_Count (Q : in Fast_Food_Queue) return Natural;
function Max_Count (Q : in Fast_Food_Queue) return Natural;
...
Cashier, Counter : Fast_Food_Queue;
...
-- Add George (see 3.10.1) to the cashier's queue:
Append (Cashier, George);
-- After payment, move George to the sandwich counter queue:
Transfer (Cashier, Counter);
...
An interface such as Queue can be used directly as the parent of a new type
(as shown here), or can be added when a new type is derived from another type.
In either case, the primitive operations of the interface are inherited. For
Queue, the implementation of the four inherited routines must be provided.
Inside the call of Transfer, dispatching calls to the implementations of
Append and Remove_First for type Fast_Food_Queue will be made.
Example of a task interface:
type Serial_Device is task interface; -- see 9.1
procedure Read (Dev : in Serial_Device; C : out Character) is abstract;
procedure Write(Dev : in Serial_Device; C : in Character) is abstract;
The Serial_Device interface has two dispatching operations
which are intended to be implemented using task entries (see 9.1).
3.10 Access Types
Replace paragraph 2: [AI95-00231-01]
access_type_definition ::=
access_to_object_definition
| access_to_subprogram_definition
by:
access_type_definition ::=
[null_exclusion] access_to_object_definition
| [null_exclusion] access_to_subprogram_definition
Replace paragraph 6: [AI95-00231-01; AI95-00254-01; AI95-00404-01]
access_definition ::= access subtype_mark
by:
null_exclusion ::= not null
access_definition ::=
[null_exclusion] access [constant] subtype_mark
| [null_exclusion] access [protected] procedure parameter_profile
| [null_exclusion] access [protected] function parameter_and_result_profile
Replace paragraph 9: [AI95-00225-01; AI95-00363-01]
A view of an object is defined to be aliased if it is defined by an
object_declaration or component_definition with the reserved word
aliased, or by a renaming of an aliased view. In addition, the dereference
of an access-to-object value denotes an aliased view, as does a view conversion
(see 4.6) of an aliased view. Finally, the current instance of a limited
type, and a formal parameter or generic formal object of a tagged type are
defined to be aliased. Aliased views are the ones that can be designated by
an access value. If the view defined by an object_declaration is aliased,
and the type of the object has discriminants, then the object is constrained;
if its nominal subtype is unconstrained, then the object is constrained by
its initial value. Similarly, if the object created by an allocator has
discriminants, the object is constrained, either by the designated subtype,
or by its initial value.
by:
A view of an object is defined to be aliased if it is defined by an
object_declaration or component_definition with the reserved word
aliased, or by a renaming of an aliased view. In addition, the dereference
of an access-to-object value denotes an aliased view, as does a view conversion
(see 4.6) of an aliased view. A current instance of a limited tagged type, a
protected type, a task type, or a type that has the reserved word limited
in its full definition is also defined to be aliased. Finally, a formal
parameter or generic formal object of a tagged type is defined to be aliased.
Aliased views are the ones that can be designated by an access value.
Replace paragraph 12: [AI95-00230-01; AI95-00231-01; AI95-00254-01]
An access_definition defines an anonymous general access-to-variable type;
the subtype_mark denotes its designated subtype. An
access_definition is used in the specification of an access discriminant
(see 3.7) or an access parameter (see 6.1).
by:
An access_definition defines an anonymous general access type or an
anonymous access-to-subprogram type. For a general access type, the
subtype_mark denotes its designated subtype; if the
general_access_modifier constant appears, the type is an
access-to-constant type; otherwise it is
an access-to-variable type. For an access-to-subprogram type, the
parameter_profile or parameter_and_result_profile denotes its
designated profile.
Replace paragraph 13: [AI95-00230-01; AI95-00231-01]
For each (named) access type, there is a literal null which has a null access
value designating no entity at all. The null value of a named access type is
the default initial value of the type. Other values of an access type are
obtained by evaluating an attribute_reference for the Access or
Unchecked_Access attribute of an aliased view of an object or non-intrinsic
subprogram, or, in the case of a named access-to-object type, an allocator,
which returns an access value designating a newly created object (see 3.10.2).
by:
For each access type, there is a null access value designating no entity at
all, which can be obtained by converting the literal null to the access
type. The null value of an access type is the default initial value of the
type. Non-null values of an access-to-object type are obtained by evaluating an
allocator, which returns an access value designating a newly created
object (see 3.10.2), or in the case of a general access-to-object type,
evaluating an attribute_reference for the Access or Unchecked_Access
attribute of an aliased view of an object. Non-null values of an
access-to-subprogram type are obtained by evaluating an
attribute_reference for the Access attribute of a non-intrinsic
subprogram.
A null_exclusion in an access_definition, access_type_definition,
subtype_indication (see 3.2.2), discriminant_specification (see 3.7),
parameter_specification (see 6.1),
parameter_and_result_profile (see 6.1), object_renaming_declaration
(see 8.5.1), or formal_object_declaration (see 12.4) specifies that the
null value does not belong to the access subtype defined by the construct, that
is, the access subtype excludes null. In addition, the anonymous access
subtype defined by the access_definition for a controlling access
parameter (see 3.9.2) excludes null.
Finally, for a subtype_indication without a null_exclusion,
the subtype denoted by the subtype_indication excludes null if and
only if the subtype denoted by the subtype_mark in the
subtype_indication does.
Insert after paragraph 14: [AI95-00231-01]
All subtypes of an access-to-subprogram type are constrained. The first subtype
of a type defined by an access_definition or an
access_to_object_definition is unconstrained if the designated subtype is
an unconstrained array or discriminated subtype; otherwise it is constrained.
the new paragraph:
A null_exclusion is only allowed in a subtype_indication,
discriminant_specification, parameter_specification,
parameter_and_result_profile, object_renaming_declaration, or
formal_object_declaration whose subtype_mark
denotes an access subtype that does not exclude null.
Replace paragraph 15: [AI95-00231-01]
A composite_constraint is compatible with an unconstrained access
subtype if it is compatible with the designated subtype. An access value
satisfies a composite_constraint of an access subtype if it equals the
null value of its type or if it designates an object whose value satisfies the
constraint.
by:
A composite_constraint is compatible with an unconstrained access
subtype if it is compatible with the designated subtype. A null_exclusion
is compatible with any access subtype that does not exclude null. An
access value satisfies a composite_constraint of an access subtype if
it equals the null value of its type or if it designates an object whose value
satisfies the constraint. An access value satisfies an access subtype that
excludes null if it does not equal the null value of its type.
Replace paragraph 17: [AI95-00230-01; AI95-00254-01]
The elaboration of an access_definition creates an anonymous general
access-to-variable type [(this happens as part of the initialization of an
access parameter or access discriminant)].
by:
The elaboration of an access_definition creates an anonymous access type.
Replace paragraph 22: [AI95-00433-01]
type Peripheral_Ref is access Peripheral; -- see 3.8.1
type Binop_Ptr is access all Binary_Operation'Class;
-- general access-to-class-wide, see 3.9.1
by:
type Peripheral_Ref is not null access Peripheral; -- see 3.8.1
type Binop_Ptr is access all Binary_Operation'Class;
-- general access-to-class-wide, see 3.9.1
3.10.1 Incomplete Type Declarations
Replace paragraph 2: [AI95-00326-01; AI95-00412-01]
incomplete_type_declaration ::= type defining_identifier [discriminant_part];
by:
incomplete_type_declaration ::= type defining_identifier [discriminant_part] [is tagged];
An incomplete_type_declaration declares an incomplete view of a type
and its first subtype; the first subtype is unconstrained if a
discriminant_part appears. If the incomplete_type_declaration
includes the reserved word tagged, it declares a tagged incomplete view.
An incomplete view of a type is a limited view of the type (see 7.5).
Given an access type A whose designated type T is an incomplete view,
a dereference of a value of type A also has this incomplete view
except when:
-
it occurs within the immediate scope of the completion of T, or
-
it occurs within the scope of a nonlimited_with_clause that mentions
a library package in whose visible part the completion of T is declared.
In these cases, the dereference has the full view of T.
Similarly, if a subtype_mark denotes a subtype_declaration defining
a subtype of an incomplete view T, the subtype_mark denotes an
incomplete view except under the same two circumstances given above,
in which case it denotes the full view of T.
Replace paragraph 4: [AI95-00326-01]
If an incomplete_type_declaration has a known_discriminant_part, then
a full_type_declaration that completes it shall have a fully conforming
(explicit) known_discriminant_part (see 6.3.1). If an
incomplete_type_declaration has no discriminant_part (or an
unknown_discriminant_part), then a corresponding full_type_declaration
is nevertheless allowed to have discriminants, either explicitly, or inherited
via derivation.
by:
If an incomplete_type_declaration includes the reserved word tagged, then a
full_type_declaration that completes it shall declare a tagged type.
If an incomplete_type_declaration has a known_discriminant_part, then
a full_type_declaration that completes it shall have a fully conforming
(explicit) known_discriminant_part (see 6.3.1). If an
incomplete_type_declaration has no discriminant_part (or an
unknown_discriminant_part), then a corresponding full_type_declaration
is nevertheless allowed to have discriminants, either explicitly, or inherited
via derivation.
Replace paragraph 5: [AI95-00326-01]
The only allowed uses of a name that denotes an
incomplete_type_declaration are as follows:
by:
A name that denotes an incomplete view of a type may be used as follows:
Replace paragraph 7: [AI95-00326-01; AI95-00412-01]
-
as the subtype_mark defining the subtype of a parameter or
result of an access_to_subprogram_definition;
by:
-
as the subtype_mark in the subtype_indication of a
subtype_declaration; the subtype_indication shall not have a
null_exclusion or a constraint;
Replace paragraph 8: [AI95-00326-01]
-
as the subtype_mark in an access_definition;
by:
-
as the subtype_mark in an access_definition.
If such a name denotes a tagged incomplete view, it may also be used:
-
as the subtype_mark defining the subtype of a parameter in a
formal_part;
Replace paragraph 9: [AI95-00326-01]
-
as the prefix of an attribute_reference whose
attribute_designator is Class; such an attribute_reference is
similarly restricted to the uses allowed here; when used in this way, the
corresponding full_type_declaration shall declare a tagged type, and the
attribute_reference shall occur in the same library unit as the
incomplete_type_declaration.
by:
-
as the prefix of an attribute_reference whose
attribute_designator is Class; such an attribute_reference is
restricted to the uses allowed here; it denotes a tagged incomplete view.
If such a name occurs within the list of declarative_items containing
the completion of the incomplete view, it may also be used:
-
as the subtype_mark defining the subtype of a parameter or result
of an access_to_subprogram_definition.
If any of the above uses occurs as part of the declaration of a primitive
subprogram of the incomplete view, and the declaration occurs immediately
within the private part of a package, then the completion of the incomplete
view shall also occur immediately within the private part; it shall not be
deferred to the package body.
No other uses of a name that denotes an incomplete view of a type are
allowed.
Replace paragraph 10: [AI95-00217-06; AI95-00326-01]
A dereference (whether implicit or explicit -- see 4.1) shall not be
of an incomplete type.
by:
A prefix shall not be of an incomplete view.
Delete paragraph 11: [AI95-00326-01]
An incomplete_type_declaration declares an incomplete type and its first
subtype; the first subtype is unconstrained if a known_discriminant_part
appears.
Replace paragraph 19: [AI95-00433-01]
type Person(<>); -- incomplete type declaration
type Car; -- incomplete type declaration
by:
type Person(<>); -- incomplete type declaration
type Car is tagged; -- incomplete type declaration
Replace paragraph 20: [AI95-00433-01]
type Person_Name is access Person;
type Car_Name is access all Car;
by:
type Person_Name is access Person;
type Car_Name is access all Car'Class;
Replace paragraph 21: [AI95-00433-01]
type Car is
record
Number : Integer;
Owner : Person_Name;
end record;
by:
type Car is tagged
record
Number : Integer;
Owner : Person_Name;
end record;
3.10.2 Operations of Access Types
Replace paragraph 2: [AI95-00235-01]
For an attribute_reference with attribute_designator Access (or
Unchecked_Access — see 13.10), the expected type shall be
a single access type; the prefix of such an attribute_reference
is never interpreted as an implicit_dereference. If the expected
type is an access-to-subprogram type, then the expected profile
of the prefix is the designated profile of the access type.
by:
For an attribute_reference with attribute_designator Access (or
Unchecked_Access — see 13.10), the expected type shall be
a single access type A such that:
-
A is an access-to-object type with designated type D and the
type of the prefix is D'Class or is covered by D, or
-
A is an access-to-subprogram type whose designated profile is type
conformant with that of the prefix.
The prefix of such an attribute_reference is never interpreted as an
implicit_dereference or a parameterless function_call (see 4.1.4).
The designated type or profile of the expected type of the
attribute_reference is the expected type or profile for the prefix.
Replace paragraph 3: [AI95-00162-01]
The accessibility rules, which prevent dangling references, are written in
terms of accessibility levels, which reflect the run-time nesting of
masters. As explained in 7.6.1, a master is the execution of a task_body,
a block_statement, a subprogram_body, an entry_body, or an
accept_statement. An accessibility level is deeper than another if it
is more deeply nested at run time. For example, an object declared local to a
called subprogram has a deeper accessibility level than an object declared
local to the calling subprogram. The accessibility rules for access types
require that the accessibility level of an object designated by an access value
be no deeper than that of the access type. This ensures that the object will
live at least as long as the access type, which in turn ensures that the access
value cannot later designate an object that no longer exists. The
Unchecked_Access attribute may be used to circumvent the accessibility rules.
by:
The accessibility rules, which prevent dangling references, are written in
terms of accessibility levels, which reflect the run-time nesting of
masters (see 7.6.1). An accessibility level is deeper than another if it
is more deeply nested at run time. For example, an object declared local to a
called subprogram has a deeper accessibility level than an object declared
local to the calling subprogram. The accessibility rules for access types
require that the accessibility level of an object designated by an access value
be no deeper than that of the access type. This ensures that the object will
live at least as long as the access type, which in turn ensures that the access
value cannot later designate an object that no longer exists. The
Unchecked_Access attribute may be used to circumvent the accessibility rules.
Replace paragraph 7: [AI95-00162-01; AI95-00416-01]
-
An entity or view created by a declaration has the same accessibility
level as the innermost enclosing master, except in the cases of renaming and
derived access types described below. A parameter of a master has the same
accessibility level as the master.
by:
-
An entity or view defined by a declaration and created as part of
its elaboration has the same accessibility
level as the innermost master of the declaration
except in the cases of renaming and derived access types described below. A
parameter of a master has the same accessibility level as the master.
Replace paragraph 9: [AI95-00416-01]
-
The accessibility level of a view conversion is the same as that of
the operand.
by:
-
The accessibility level of a view conversion, qualified_expression,
or parenthesized expression, is the same as that of the operand.
Replace paragraph 10: [AI95-00318-02; AI95-00416-01]
-
For a function whose result type is a return-by-reference type, the
accessibility level of the result object is the same as that of the master that
elaborated the function body. For any other function, the accessibility level
of the result object is that of the execution of the called function.
by:
-
The accessibility level of the result of a function call that is
used as a prefix of a name, as the actual parameter in a call, or
as the expression of an assignment_statement,
is that of the innermost master of the function call. In other contexts, the
accessibility level is that of the object being initialized from
the function result.
-
Within a return statement, the accessibility level of the return
object is that of the execution of the return statement. If the
return statement completes normally by returning from the
function, prior to leaving the function, the accessibility level
of the return object changes to be a level determined by the point
of call, as does the level of any coextensions (see below) of the
return object.
Replace paragraph 12: [AI95-00230-01; AI95-00416-01]
-
The accessibility level of the anonymous access type of an access
discriminant is the same as that of the containing object or associated
constrained subtype.
by:
-
The accessibility level of the anonymous access type defined by an
access_definition of an object_renaming_declaration is the same as
that of the renamed view.
-
For an access discriminant, the accessibility level of its
anonymous access type is determined as follows:
-
For an access discriminant whose value is determined by a
discriminant_association in a subtype_indication, the
accessibility level of the object or subprogram designated by
the associated value (or library level if the value is null);
-
For an access discriminant of an object defined by an aggregate
where the value of the discriminant is determined by a
component_association in the aggregate, the accessibility
level of the object or subprogram designated by the associated
value (or library level if the value is null);
-
For an access discriminant of any other object with an unconstrained
nominal subtype, the accessibility level of the object.
Replace paragraph 13: [AI95-00162-01; AI95-00254-01; AI95-00318-02; AI95-00416-01]
-
The accessibility level of the anonymous access type of an access
parameter is the same as that of the view designated by the actual. If the
actual is an allocator, this is the accessibility level of the execution
of the called subprogram.
by:
-
The accessibility level of the anonymous access type of an access
parameter specifying an access-to-object type is the same as that of the view
designated by the actual.
-
The accessibility level of the anonymous access type of an access
parameter specifying an access-to-subprogram type is statically deeper than
that of any master; all such anonymous access types have this same level.
Replace paragraph 14: [AI95-00416-01]
-
The accessibility level of an object created by an allocator is
the same as that of the access type.
by:
-
The accessibility level of an object created by an allocator is
the same as that of the access type, except for an allocator of an
anonymous access type that defines the value of an access parameter or
an access discriminant. For an allocator defining the value of
an access parameter, the accessibility level is that of the
innermost master of the call. For one defining an access
discriminant, the accessibility level is determined as follows:
-
for an allocator used to define the constraint in a
subtype_declaration, the level of the subtype_declaration;
-
for an allocator used to define the constraint in a
component_definition, the level of the enclosing type;
-
for an allocator used to define the discriminant of an object,
the level of the object.
In this last case, the allocated object is said to be a
coextension of the object whose discriminant designates it, as well as of
any object of which the discriminated object is itself a coextension or
subcomponent. All coextensions of an object are finalized when the object is
finalized (see 7.6.1).
Insert after paragraph 16: [AI95-00416-01]
-
The accessibility level of a component, protected subprogram, or entry
of (a view of) a composite object is the same as that of (the view of) the
composite object.
the new paragraph:
For determining whether an expression is used in a certain context, the
operand of a view conversion, parenthesized expression or
qualified_expression is considered to be used in a context if the view
conversion, parenthesized expression or qualified_expression itself is
used in that context.
Replace paragraph 19: [AI95-00254-01]
The statically deeper relationship does not apply to the accessibility
level of the anonymous type of an access parameter;
that is, such an accessibility level is not considered to be statically
deeper, nor statically shallower, than any other.
by:
The statically deeper relationship does not apply to the accessibility
level of the anonymous type of an access parameter specifying an
access-to-object type;
that is, such an accessibility level is not considered to be statically
deeper, nor statically shallower, than any other.
Replace paragraph 26: [AI95-00363-01]
-
The view shall not be a subcomponent that depends on discriminants of
a variable whose nominal subtype is unconstrained, unless this subtype is
indefinite, or the variable is aliased.
by:
-
The view shall not be a subcomponent that depends on discriminants of
a variable whose nominal subtype is unconstrained, unless this subtype is
indefinite, or the variable is constrained by its initial value.
Replace paragraph 27: [AI95-00363-01]
-
If A is a named access type and D is a tagged type, then the
type of the view shall be covered by D; if A is anonymous and D is
tagged, then the type of the view shall be either D'Class or a type
covered by D; if D is untagged, then the type of the view shall be
D, and A's designated subtype shall either statically match the
nominal subtype of the view or be discriminated and unconstrained;
by:
-
If A is a named access type and D is a tagged type, then the
type of the view shall be covered by D; if A is anonymous and D is
tagged, then the type of the view shall be either D'Class or a type
covered by D; if D is untagged, then the type of the view shall be
D, and either:
-
the designated subtype of A shall statically match the nominal
subtype of the view; or
-
D shall be discriminated in its full view and unconstrained in any
partial view, and the designated subtype of A shall be unconstrained.
Replace paragraph 32: [AI95-00229-01; AI95-00254-01]
P'Access yields an access value that designates the subprogram
denoted by P. The type of P'Access is an access-to-subprogram
type (S), as determined by the expected type. The accessibility
level of P shall not be statically deeper than that of S. In
addition to the places where Legality Rules normally apply (see
12.3), this rule applies also in the private part of an instance
of a generic unit. The profile of P shall be subtype-conformant
with the designated profile of S, and shall not be Intrinsic. If
the subprogram denoted by P is declared within a generic body, S
shall be declared within the generic body.
by:
P'Access yields an access value that designates the subprogram
denoted by P. The type of P'Access is an access-to-subprogram
type (S), as determined by the expected type. The accessibility
level of P shall not be statically deeper than that of S. In
addition to the places where Legality Rules normally apply (see
12.3), this rule applies also in the private part of an instance
of a generic unit. The profile of P shall be subtype-conformant
with the designated profile of S, and shall not be Intrinsic.
If the subprogram denoted by P is declared within a generic unit,
and the expression P'Access occurs within the body of that generic
unit or within the body of a generic unit declared within
the declarative region of the generic unit, then the ultimate ancestor
of S shall be either a non-formal type declared within the generic
unit or an anonymous access type of an access parameter.
Replace paragraph 34: [AI95-00230-01]
82 The predefined operations of an access type also include the
assignment operation, qualification, and membership tests. Explicit conversion
is allowed between general access types with matching designated subtypes;
explicit conversion is allowed between access-to-subprogram types with subtype
conformant profiles (see 4.6). Named access types have predefined equality
operators; anonymous access types do not (see 4.5.2).
by:
82 The predefined operations of an access type also include the
assignment operation, qualification, and membership tests. Explicit conversion
is allowed between general access types with matching designated subtypes;
explicit conversion is allowed between access-to-subprogram types with subtype
conformant profiles (see 4.6). Named access types have predefined equality
operators; anonymous access types do not, but they can use the predefined
equality operators for universal_access (see 4.5.2).
Replace paragraph 37: [AI95-00254-01]
The accessibility rules imply that it is not possible to use the
Access attribute to implement "downward closures" — that is, to pass a
more-nested subprogram as a parameter to a less-nested subprogram, as might be
desired for example for an iterator abstraction. Instead, downward closures can
be implemented using generic formal subprograms (see 12.6). Note that
Unchecked_Access is not allowed for subprograms.
by:
88 The Access attribute for subprograms and parameters of an
anonymous access-to-subprogram type may together be used to implement
"downward closures" — that is, to pass a more-nested
subprogram as a parameter to a less-nested subprogram,
as might be appropriate for an iterator abstraction or
numerical integration. Downward closures can also be implemented
using generic formal subprograms (see 12.6). Note that Unchecked_Access is
not allowed for subprograms.
Section 4: Names and Expressions
4.1 Names
Replace paragraph 11: [AI95-00415-01]
The evaluation of a name determines the entity denoted by the
name. This evaluation has no other effect for a name that
is a direct_name or a character_literal.
by:
The evaluation of a name determines the entity denoted by the
name. This evaluation has no other effect for a name that
is a direct_name or a character_literal.
4.1.3 Selected Components
Insert after paragraph 9: [AI95-00252-01; AI95-00407-01]
-
The prefix shall resolve to denote an object or value of some
task or protected type (after any implicit dereference). The selector_name
shall resolve to denote an entry_declaration or
subprogram_declaration occurring (implicitly or explicitly) within the
visible part of that type. The selected_component denotes the
corresponding entry, entry family, or protected subprogram.
the new paragraph:
-
A view of a subprogram whose first formal parameter is of a tagged
type or is an access parameter whose designated type is tagged:
The prefix (after any implicit dereference) shall resolve to
denote an object or value of a specific tagged type T or class-wide type
T'Class. The selector_name shall resolve to denote a view of a
subprogram declared immediately within the declarative region in which an
ancestor of the type T is declared. The first formal parameter of the
subprogram shall be of type T, or a class-wide type that covers T, or
an access parameter designating one of these types. The designator of the
subprogram shall not be the same as that of a component of the tagged type
visible at the point of the selected_component. The
selected_component denotes a view of this subprogram that omits the first
formal parameter. This view is called a prefixed view of the subprogram,
and the prefix of the selected_component (after any implicit
dereference) is called the prefix of the prefixed view.
Insert after paragraph 13: [AI95-00252-01; AI95-00407-01]
If the prefix does not denote a package, then it shall be a
direct_name or an expanded name, and it shall resolve to denote a program
unit (other than a package), the current instance of a type, a
block_statement, a loop_statement, or an accept_statement (in
the case of an accept_statement or entry_body, no family index is
allowed); the expanded name shall occur within the declarative region of this
construct. Further, if this construct is a callable construct and the
prefix denotes more than one such enclosing callable construct, then the
expanded name is ambiguous, independently of the selector_name.
the new paragraph:
For a subprogram whose first parameter is an access parameter, the prefix of
any prefixed view shall denote an aliased view of an object.
For a subprogram whose first parameter is of mode in out or out, or of
an anonymous access-to-variable type, the prefix of any prefixed view shall
denote a variable.
In paragraph 17 replace: [AI95-00252-01; AI95-00407-01]
Control.Seize -- an entry of a protected object (see 9.4)
by:
Cashier.Append -- a prefixed view of a procedure (see 3.9.4)
Control.Seize -- an entry of a protected object (see 9.4)
4.1.4 Attributes
Replace paragraph 14: [AI95-00235-01]
5 In general, the name in a prefix of an
attribute_reference (or a
range_attribute_reference) has to be resolved without using any context.
However, in the case of the Access attribute, the expected type for the
prefix has to be a single access type, and if it is an
access-to-subprogram type (see 3.10.2) then the resolution of the name can
use the fact that the profile of the callable entity denoted by the prefix has
to be type conformant with the designated profile of the access type.
by:
5 In general, the name in a prefix of an
attribute_reference (or a
range_attribute_reference) has to be resolved without using any context.
However, in the case of the Access attribute, the expected type for the
attribute_reference has to be a single access type, and the resolution of
the name can use the fact that the type of the object or the profile of
the callable entity denoted by the prefix has to match the designated
type or be type conformant with the designated profile of the access type.
4.2 Literals
Delete paragraph 2: [AI95-00230-01]
The expected type for a literal null shall be a single access type.
Delete paragraph 7: [AI95-00230-01; AI95-00231-01]
A literal null shall not be of an anonymous access type, since such types
do not have a null value (see 3.10).
Replace paragraph 8: [AI95-00230-01]
An integer literal is of type universal_integer. A real literal is of type
universal_real.
by:
An integer literal is of type universal_integer. A real literal is of type
universal_real. The literal null is of type universal_access.
4.3 Aggregates
Replace paragraph 3: [AI95-00287-01]
The expected type for an aggregate shall be a single nonlimited array
type, record type, or record extension.
by:
The expected type for an aggregate shall be a single array type, record
type, or record extension.
4.3.1 Record Aggregates
Replace paragraph 4: [AI95-00287-01]
record_component_association ::=
[ component_choice_list => ] expression
by:
record_component_association ::=
[ component_choice_list => ] expression
| component_choice_list => <>
Replace paragraph 8: [AI95-00287-01]
The expected type for a record_aggregate shall be a single nonlimited
record type or record extension.
by:
The expected type for a record_aggregate shall be a single
record type or record extension.
Replace paragraph 16: [AI95-00287-01]
Each record_component_association shall have at least one associated
component, and each needed component shall be associated with exactly one
record_component_association. If a record_component_association has
two or more associated components, all of them shall be of the same type.
by:
Each record_component_association other than an others choice with
a <> shall have at least one associated component, and each needed component
shall be associated with exactly one record_component_association. If a
record_component_association with an expression has two or more
associated components, all of them shall be of the same type.
Insert after paragraph 17: [AI95-00287-01]
If the components of a variant_part are needed, then the value of a
discriminant that governs the variant_part shall be given by a static
expression.
the new paragraph:
A record_component_association for a discriminant without a
default_expression shall have an expression rather than <>.
Insert before paragraph 20: [AI95-00287-01]
The expression of a record_component_association is evaluated (and
converted) once for each associated component.
the new paragraph:
For a record_component_association with an expression, the
expression defines the value for the associated component(s). For a
record_component_association with <>, if the component_declaration
has a default_expression, that default_expression defines the value
for the associated component(s); otherwise, the associated component(s) are
initialized by default as for a stand-alone object of the component subtype
(see 3.3.1).
Insert after paragraph 29: [AI95-00287-01]
-- The allocator is evaluated twice: Succ and Pred designate different cells
the new paragraphs:
(Value => 0, Succ|Pred => <>) -- see 3.10.1
-- Succ and Pred will be set to null
4.3.2 Extension Aggregates
Replace paragraph 4: [AI95-00287-01]
The expected type for an extension_aggregate shall be a single nonlimited
type that is a record extension. If the ancestor_part is an
expression, it is expected to be of any nonlimited tagged type.
by:
The expected type for an extension_aggregate shall be a single type that
is a record extension. If the ancestor_part is an expression, it is
expected to be of any tagged type.
Replace paragraph 5: [AI95-00306-01]
If the ancestor_part is a subtype_mark, it shall denote a specific
tagged subtype. The type of the extension_aggregate shall be derived from
the type of the ancestor_part, through one or more record extensions (and
no private extensions).
by:
If the ancestor_part is a subtype_mark, it shall denote a specific
tagged subtype. If the ancestor_part is an expression, it shall not
be dynamically tagged. The type of the extension_aggregate shall be
derived from the type of the ancestor_part, through one or more record
extensions (and no private extensions).
4.3.3 Array Aggregates
Replace paragraph 3: [AI95-00287-01]
positional_array_aggregate ::=
(expression, expression {, expression})
| (expression {, expression}, others => expression)
by:
positional_array_aggregate ::=
(expression, expression {, expression})
| (expression {, expression}, others => expression)
| (expression {, expression}, others => <>)
Replace paragraph 5: [AI95-00287-01]
array_component_association ::=
discrete_choice_list => expression
by:
array_component_association ::=
discrete_choice_list => expression
| discrete_choice_list => <>
Replace paragraph 7: [AI95-00287-01]
The expected type for an array_aggregate (that is not a subaggregate)
shall be a single nonlimited array type. The component type of this array type
is the expected type for each array component expression of the
array_aggregate.
by:
The expected type for an array_aggregate (that is not a subaggregate)
shall be a single array type. The component type of this array type is the
expected type for each array component expression of the array_aggregate.
Replace paragraph 11: [AI95-00318-02]
For an explicit_actual_parameter, an
explicit_generic_actual_parameter, the
expression of a return_statement, the initialization expression in an
object_declaration, or a default_expression (for a parameter or a
component), when the nominal subtype of the corresponding formal parameter,
generic formal parameter, function result, object, or component is a
constrained array subtype, the applicable index constraint is the constraint of
the subtype;
by:
For an explicit_actual_parameter, an
explicit_generic_actual_parameter, the
expression of a return statement, the initialization expression in an
object_declaration, or a default_expression (for a parameter or a
component), when the nominal subtype of the corresponding formal parameter,
generic formal parameter, function return object, object, or component is a
constrained array subtype, the applicable index constraint is the constraint of
the subtype;
Insert before paragraph 24: [AI95-00287-01]
The bounds of the index range of an array_aggregate (including a
subaggregate) are determined as follows:
the new paragraph:
Each expression in an
array_component_association defines the value for the associated
component(s). For an array_component_association with <>, the associated
component(s) are initialized by default as for a stand-alone object of the
component subtype (see 3.3.1).
Insert after paragraph 43: [AI95-00433-01]
D : Bit_Vector(M .. N) := (M .. N => True); -- see 3.6
E : Bit_Vector(M .. N) := (others => True);
F : String(1 .. 1) := (1 => 'F'); -- a one component aggregate: same as "F"
the new paragraphs:
Example of array aggregate with defaulted others choice, with applicable
index constraint provided by an enclosing record aggregate:
Buffer'(Size => 50, Pos => 1, Value => String'('x', others => <>)) -- see 3.7
4.4 Expressions
Replace paragraph 15: [AI95-00433-01]
Volume -- primary
not Destroyed -- factor
2*Line_Count -- term
-4.0 -- simple expression
-4.0 + A -- simple expression
B**2 - 4.0*A*C -- simple expression
Password(1 .. 3) = "Bwv" -- relation
Count in Small_Int -- relation
Count not in Small_Int -- relation
Index = 0 or Item_Hit -- expression
(Cold and Sunny) or Warm -- expression (parentheses are required)
A**(B**C) -- expression (parentheses are required)
by:
Volume -- primary
not Destroyed -- factor
2*Line_Count -- term
-4.0 -- simple expression
-4.0 + A -- simple expression
B**2 - 4.0*A*C -- simple expression
R*Sin(θ)*Cos(φ) -- simple expression
Password(1 .. 3) = "Bwv" -- relation
Count in Small_Int -- relation
Count not in Small_Int -- relation
Index = 0 or Item_Hit -- expression
(Cold and Sunny) or Warm -- expression (parentheses are required)
A**(B**C) -- expression (parentheses are required)
4.5.2 Relational Operators and Membership Tests
Replace paragraph 3: [AI95-00251-01]
The tested type of a membership test is the type of the range or the
type determined by the subtype_mark. If the tested type is tagged, then
the simple_expression shall resolve to be of a type that covers or is
covered by the tested type; if untagged, the expected type for the
simple_expression is the tested type.
by:
The tested type of a membership test is the type of the range or the
type determined by the subtype_mark. If the tested type is tagged, then
the simple_expression shall resolve to be of a type that is
convertible (see 4.6) to the tested type; if untagged, the expected
type for the simple_expression is the tested type.
Insert after paragraph 7: [AI95-00230-01]
function "=" (Left, Right : T) return Boolean
function "/="(Left, Right : T) return Boolean
the new paragraphs:
The following additional equality operators for the universal_access type
are declared in package Standard for use with anonymous access types:
function "=" (Left, Right : universal_access) return Boolean
function "/="(Left, Right : universal_access) return Boolean
Insert after paragraph 9: [AI95-00230-01; AI95-00420-01]
function "<" (Left, Right : T) return Boolean
function "<="(Left, Right : T) return Boolean
function ">" (Left, Right : T) return Boolean
function ">="(Left, Right : T) return Boolean
the new paragraphs:
At least one of the operands of the equality operators for universal_access
shall be of a specific anonymous access type.
These equality operators shall not be used if either operand is of a type whose
designated type D has a user-defined primitive equality operator with
result type Boolean, that is declared immediately within the same list of
declarations as D, and at least one of whose operands is an access
parameter also with designated type D, unless the predefined equality
operator is identified using an expanded name with prefix denoting the package
Standard.
The operands of the equality operators for universal_access shall be
convertible to one another (see 4.6).
Replace paragraph 30: [AI95-00231-01]
-
The tested type is not scalar, and
the value of the simple_expression satisfies any constraints
of the named subtype, and, if the type of the simple_expression
is class-wide, the value has a tag that identifies a type covered by
the tested type.
by:
-
The tested type is not scalar, and
the value of the simple_expression satisfies any constraints
of the named subtype, and:
-
if the type of the simple_expression is class-wide, the
value has a tag that identifies a type covered by the tested type;
-
if the tested type is an access type and the named subtype excludes
null, the value of the simple_expression is not null.
4.5.5 Multiplying Operators
Replace paragraph 20: [AI95-00230-01; AI95-00420-01]
The above two fixed-fixed multiplying operators shall not be used in a context
where the expected type for the result is itself universal_fixed — the
context has to identify some other numeric type to which the result is to be
converted, either explicitly or implicitly.
by:
The above two fixed-fixed multiplying operators shall not be used in a
context where the expected type for the result is itself universal_fixed
— the context has to identify some other numeric type to which the
result is to be converted, either explicitly or implicitly. An
explicit conversion is required on the result when using the above
fixed-fixed multiplication operator when either operand is of a type having
a user-defined primitive multiplication operator declared immediately
within the same list of declarations as the type and with both formal
parameters of a fixed-point type, unless the predefined universal
operator is identified using an expanded name with the prefix denoting the
package Standard. A corresponding requirement applies to the universal
fixed-fixed division operator.
4.6 Type Conversions
Replace paragraph 5: [AI95-00330-01]
A type_conversion whose operand is the name of an object is called a
view conversion if both its target type and operand type are tagged, or if
it appears as an actual parameter of mode out or in out; other
type_conversions are called value conversions.
by:
A type_conversion whose operand is the name of an object is called a
view conversion if both its target type and operand type are tagged, or if
it appears in a call as an actual parameter of mode out or in out;
other type_conversions are called value conversions.
Replace paragraph 8: [AI95-00251-01]
If the target type is a numeric type, then the operand type shall be a numeric
type.
by:
In a view conversion for an untagged type, the target type shall be convertible
(back) to the operand type.
Delete paragraph 9: [AI95-00246-01; AI95-00251-01]
If the target type is an array type, then the operand type shall be an array
type. Further:
Delete paragraph 10: [AI95-00251-01]
-
The types shall have the same dimensionality;
Delete paragraph 11: [AI95-00251-01]
-
Corresponding index types shall be convertible;
Delete paragraph 12: [AI95-00246-01; AI95-00251-01; AI95-00392-01]
-
The component subtypes shall statically match; and
Delete paragraph 12.1: [AI95-00246-01; AI95-00251-01; AI95-00363-01]
-
In a view conversion, the target type and the operand type shall both
or neither have aliased components.
Delete paragraph 13: [AI95-00230-01; AI95-00251-01]
If the target type is a general access type, then the operand type shall be an
access-to-object type. Further:
Delete paragraph 14: [AI95-00251-01]
-
If the target type is an access-to-variable type, then the operand
type shall be an access-to-variable type;
Delete paragraph 15: [AI95-00251-01]
-
If the target designated type is tagged, then the operand designated
type shall be convertible to the target designated type;
Delete paragraph 16: [AI95-00251-01; AI95-00363-01; AI95-00384-01]
-
If the target designated type is not tagged, then the designated types
shall be the same, and either the designated subtypes shall statically match or
the target designated subtype shall be discriminated and unconstrained; and
Delete paragraph 17: [AI95-00251-01]
-
The accessibility level of the operand type shall not be statically
deeper than that of the target type. In addition to the places where Legality
Rules normally apply (see 12.3), this rule applies also in the private part of
an instance of a generic unit.
Delete paragraph 18: [AI95-00230-01; AI95-00251-01]
If the target type is an access-to-subprogram type, then the operand type
shall be an access-to-subprogram type. Further:
Delete paragraph 19: [AI95-00251-01]
-
The designated profiles shall be subtype-conformant.
Delete paragraph 20: [AI95-00251-01]
-
The accessibility level of the operand type shall not be statically
deeper than that of the target type. In addition to the places where Legality
Rules normally apply (see 12.3), this rule applies also in the private part of
an instance of a generic unit. If the operand type is declared within a generic
body, the target type shall be declared within the generic body.
Replace paragraph 21: [AI95-00251-01]
If the target type is not included in any of the above four cases, there shall
be a type that is an ancestor of both the target type and the operand type.
Further, if the target type is tagged, then either:
by:
If there is a type that is an ancestor of both the target type and the
operand type, or both types are class-wide types, then at least
one of the following rules shall apply:
-
The target type shall be untagged; or
Replace paragraph 23: [AI95-00251-01]
-
The operand type shall be a class-wide type that covers the target
type.
by:
-
The operand type shall be a class-wide type that covers the target
type; or
-
The operand and target types shall both be class-wide types and the
specific type associated with at least one of them shall be an interface type.
Replace paragraph 24: [AI95-00230-01; AI95-00246-01; AI95-00251-01; AI95-00392-01]
In a view conversion for an untagged type, the target type shall be convertible
(back) to the operand type.
by:
If there is no type that is the ancestor of both the target type and the
operand type, and they are not both class-wide types, one of the following
rules shall apply:
-
If the target type is a numeric type, then the operand type shall be a
numeric type.
-
If the target type is an array type, then the operand type shall be an array
type. Further:
-
The types shall have the same dimensionality;
-
Corresponding index types shall be convertible;
-
The component subtypes shall statically match;
-
If the component types are anonymous access types, then the
accessibility level of the operand type shall not be statically deeper
than that of the target type;
-
Neither the target type nor the operand type shall be limited;
-
If the target type of a view conversion has aliased components, then
so shall the operand type; and
-
The operand type of a view conversion shall not have
a tagged, private, or volatile subcomponent.
-
If the target type is universal_access, then the operand type shall be an
access type.
-
If the target type is a general access-to-object type, then
the operand type shall be universal_access or an access-to-object type.
Further, if the operand type is not universal_access:
-
If the target type is an access-to-variable type, then the operand
type shall be an access-to-variable type;
-
If the target designated type is tagged, then the operand designated
type shall be convertible to the target designated type;
-
If the target designated type is not tagged, then the designated
types shall be the same, and either:
-
the designated subtypes shall statically match; or
-
the designated type shall be discriminated in its full view and
unconstrained in any partial view, and one of the designated
subtypes shall be unconstrained;
-
The accessibility level of the operand type shall not be statically
deeper than that of the target type. In addition to the places where Legality
Rules normally apply (see 12.3), this rule applies also in the private part of
an instance of a generic unit.
-
If the target type is an access-to-subprogram type, then the operand
type shall be universal_access or an access-to-subprogram type. Further, if
the operand type is not universal_access:
-
The designated profiles shall be subtype-conformant.
-
The accessibility level of the operand type shall not be statically
deeper than that of the target type. In addition to the places where Legality
Rules normally apply (see 12.3), this rule applies also in the private part of
an instance of a generic unit. If the operand type is declared within a generic
body, the target type shall be declared within the generic body.
Insert after paragraph 39: [AI95-00392-01]
-
In either array case, the value of each component of the result is
that of the matching component of the operand value (see 4.5.2).
the new paragraph:
-
If the component types of the array types are anonymous access types,
then a check is made that the accessibility level of the operand type
is not deeper than that of the target type.
Replace paragraph 49: [AI95-00230-01; AI95-00231-01]
-
If the target type is an anonymous access type, a check is made that
the value of the operand is not null; if the target is not an anonymous access
type, then the result is null if the operand value is null.
by:
-
If the operand value is null, the result of the conversion is the null
value of the target type.
Replace paragraph 51: [AI95-00231-01]
After conversion of the value to the target type, if the target subtype is
constrained, a check is performed that the value satisfies this constraint.
by:
After conversion of the value to the target type, if the target subtype is
constrained, a check is performed that the value satisfies this constraint.
If the target subtype excludes null, then a check is
made that the value is not null.
Replace paragraph 61: [AI95-00230-01]
22 A ramification of the overload resolution rules is that the operand of an
(explicit) type_conversion cannot be the literal null, an allocator,
an aggregate, a string_literal, a character_literal, or an
attribute_reference for an Access or Unchecked_Access attribute.
Similarly, such an expression enclosed by parentheses is not allowed. A
qualified_expression (see 4.7) can be used instead of such a
type_conversion.
by:
22 A ramification of the overload resolution rules is that the operand of an
(explicit) type_conversion cannot be an allocator,
an aggregate, a string_literal, a character_literal, or an
attribute_reference for an Access or Unchecked_Access attribute.
Similarly, such an expression enclosed by parentheses is not allowed. A
qualified_expression (see 4.7) can be used instead of such a
type_conversion.
4.8 Allocators
Replace paragraph 5: [AI95-00287-01; AI95-00344-01; AI95-00416-01]
If the type of the allocator is an access-to-constant type, the
allocator shall be an initialized allocator. If the designated type is
limited, the allocator shall be an uninitialized allocator.
by:
If the type of the allocator is an access-to-constant type, the
allocator shall be an initialized allocator.
If the designated type of the type of the allocator is class-wide, the
accessibility level of the type determined by the subtype_indication or
qualified_expression shall not be statically deeper than that of the type
of the allocator.
If the designated subtype of the type of the allocator has one or
more unconstrained access discriminants, then the accessibility level
of the anonymous access type of each access discriminant, as
determined by the subtype_indication or qualified_expression of the
allocator, shall not be statically deeper than that of the type of
the allocator (see 3.10.2).
Replace paragraph 6: [AI95-00363-01]
If the designated type of the type of the allocator is elementary, then
the subtype of the created object is the designated subtype. If the designated
type is composite, then the created object is always constrained; if the
designated subtype is constrained, then it provides the constraint of the
created object; otherwise, the object is constrained by its initial value (even
if the designated subtype is unconstrained with defaults).
by:
If the designated type of the type of the allocator is elementary, then
the subtype of the created object is the designated subtype. If the designated
type is composite, then the subtype of the created object is the designated
subtype when the designated subtype is constrained or there is a partial view
of the designated type that is constrained; otherwise, the created object is
constrained by its initial value (even if the designated subtype is
unconstrained with defaults).
Replace paragraph 7: [AI95-00344-01; AI95-00373-01]
For the evaluation of an allocator, the elaboration of the
subtype_indication or the evaluation of the qualified_expression is
performed first. For the evaluation of an initialized allocator, an object of
the designated type is created and the value of the qualified_expression
is converted to the designated subtype and assigned to the object.
by:
For the evaluation of an initialized allocator, the
evaluation of the qualified_expression is performed first. An
object of the designated type is created and the value of the
qualified_expression is converted to the designated subtype
and assigned to the object.
Replace paragraph 8: [AI95-00373-01]
For the evaluation of an uninitialized allocator:
by:
For the evaluation of an uninitialized allocator, the
elaboration of the subtype_indication
is performed first. Then:
Replace paragraph 10: [AI95-00373-01; AI95-00416-01]
-
If the designated type is composite, an object of the designated type
is created with tag, if any, determined by the subtype_mark of the
subtype_indication; any per-object constraints on subcomponents are
elaborated (see 3.8) and any implicit initial values for the subcomponents
of the object are obtained as determined by the subtype_indication
and assigned to the corresponding subcomponents. A check is made that the
value of the object belongs to the designated subtype. Constraint_Error is
raised if this check fails. This check and the initialization of the object are
performed in an arbitrary order.
by:
-
If the designated type is composite, an object of the
designated type is created with tag, if any, determined by
the subtype_mark of the subtype_indication. This object is
then initialized by default (see 3.3.1) using the subtype_indication as
its nominal subtype. A check is made that the value of the
object belongs to the designated subtype. Constraint_Error is
raised if this check fails. This check and the initialization
of the object are performed in an arbitrary order.
For any allocator, if the
designated type of the type of the allocator is class-wide, then
a check is made that the accessibility level of the type determined by
the subtype_indication, or by the tag of the value of the
qualified_expression, is not deeper than that
of the type of the allocator. If the
designated subtype of the allocator has one or more unconstrained
access discriminants, then a check is made that the accessibility
level of the anonymous access type of each access discriminant is
not deeper than that of the type of the allocator.
Program_Error is raised if either such check fails.
Replace paragraph 11: [AI95-00280-01]
If the created object contains any tasks, they are activated (see 9.2).
Finally, an access value that designates the created object is returned.
by:
If the object to be created by an allocator has a controlled or protected
part, and the finalization of the collection of the type of the allocator
(see 7.6.1) has started, Program_Error is raised.
If the created object contains any tasks, and the master of the type
of the allocator is completed, and all of the dependent tasks of the
master are terminated (see 9.3), then Program_Error is raised.
If the created object contains any tasks, they are activated (see 9.2).
Finally, an access value that designates the created object is returned.
Bounded (Run-Time) Errors
It is a bounded error if the finalization of the collection of the type
(see 7.6.1) of the allocator has started. If the error is detected,
Program_Error is raised. Otherwise, the allocation proceeds normally.
4.9 Static Expressions and Static Subtypes
Replace paragraph 26: [AI95-00263-01]
A static subtype is either a static scalar subtype or a static
string subtype. A static scalar subtype is an unconstrained scalar subtype
whose type is not a descendant of a formal scalar type, or a constrained
scalar subtype formed by imposing a compatible static constraint on a static
scalar subtype. A static string subtype is an unconstrained string subtype
whose index subtype and component subtype are static (and whose type is not a
descendant of a formal array type), or a constrained string subtype formed by
imposing a compatible static constraint on a static string subtype. In any
case, the subtype of a generic formal object of mode in out, and the result
subtype of a generic formal function, are not static.
by:
A static subtype is either a static scalar subtype or a static
string subtype. A static scalar subtype is an unconstrained scalar subtype
whose type is not a descendant of a formal type, or a constrained
scalar subtype formed by imposing a compatible static constraint on a static
scalar subtype. A static string subtype is an unconstrained string subtype
whose index subtype and component subtype are static, or a constrained string
subtype formed by imposing a compatible static constraint on a static string
subtype. In any case, the subtype of a generic formal object of mode in
out, and the result subtype of a generic formal function, are not static.
Insert after paragraph 31: [AI95-00311-01]
-
A discriminant constraint is static if each expression of the
constraint is static, and the subtype of each discriminant is static.
the new paragraph:
In any case, the constraint of the first subtype of a scalar formal type is
neither static nor null.
Replace paragraph 35: [AI95-00269-01]
-
If the expression is not part of a larger static expression,
then its value shall be within the base range of its expected type. Otherwise,
the value may be arbitrarily large or small.
by:
-
If the expression is not part of a larger static expression and the
expression is expected to be of a single specific type, then its value shall be
within the base range of its expected type. Otherwise, the value may be
arbitrarily large or small.
Replace paragraph 36: [AI95-00269-01]
-
If the expression is of type universal_real and its expected type
is a decimal fixed point type, then its value shall be a multiple of the
small of the decimal type.
by:
-
If the expression is of type universal_real and its expected type
is a decimal fixed point type, then its value shall be a multiple of the
small of the decimal type. This restriction does not apply if the expected type is a
descendant of a formal scalar type (or a corresponding actual type in an
instance).
Replace paragraph 37: [AI95-00269-01]
The last two restrictions above do not apply if the expected type is a
descendant of a formal scalar type (or a corresponding actual type in an
instance).
by:
In addition to the places where Legality Rules normally apply (see 12.3),
the above restrictions also apply in the private part of an instance
of a generic unit.
Replace paragraph 38: [AI95-00268-01; AI95-00269-01]
For a real static expression that is not part of a larger static
expression, and whose expected type is not a descendant of a formal scalar
type, the implementation shall round or truncate the value (according to the
Machine_Rounds attribute of the expected type) to the nearest machine number
of the expected type; if the value is exactly half-way between two machine
numbers, any rounding shall be performed away from zero. If the expected type
is a descendant of a formal scalar type, no special rounding or truncating is
required — normal accuracy rules apply (see Annex G).
by:
For a real static expression that is not part of a larger static
expression, and whose expected type is not a descendant of a formal
type, the implementation shall round or truncate the value (according to the
Machine_Rounds attribute of the expected type) to the nearest machine number
of the expected type; if the value is exactly half-way between two machine
numbers, the rounding performed is implementation-defined. If the expected type
is a descendant of a formal type, or if the static expression appears in
the body of an instance of a generic unit and the corresponding expression is
nonstatic in the corresponding generic body, then no special rounding or
truncating is required — normal accuracy rules apply (see Annex G).
For a real static expression that is not part of a larger static
expression, and whose expected type is not a descendant of a formal type,
the rounding should be the same as the default rounding for the target system.
4.9.1 Statically Matching Constraints and Subtypes
Replace paragraph 1: [AI95-00311-01]
A constraint statically matches another constraint if both are null
constraints, both are static and have equal corresponding bounds or
discriminant values, or both are nonstatic and result from the same elaboration
of a constraint of a subtype_indication or the same evaluation of a
range of a discrete_subtype_definition.
by:
A constraint statically matches another constraint if:
-
both are null constraints;
-
both are static and have equal corresponding bounds or discriminant
values;
-
both are nonstatic and result from the same elaboration
of a constraint of a subtype_indication or the same evaluation of a
range of a discrete_subtype_definition; or
-
both are nonstatic and both come from the same
formal_type_declaration.
Replace paragraph 2: [AI95-00231-01; AI95-00254-01]
A subtype statically matches another subtype of the same type if they have
statically matching constraints. Two anonymous access subtypes statically match
if their designated subtypes statically match.
by:
A subtype statically matches another subtype of the same type if they have
statically matching constraints, and, for access subtypes, either both or
neither exclude null. Two anonymous access-to-object subtypes statically match
if their designated subtypes statically match, and either both or neither
exclude null, and either both or neither are access-to-constant. Two anonymous
access-to-subprogram subtypes statically match if their designated profiles are
subtype conformant, and either both or neither exclude null.
Section 5: Statements
Replace paragraph 2: [AI95-00318-02]
This section describes the general rules applicable to all statements. Some
statements are discussed in later sections: Procedure_call_statements and
return_statements are described in 6, "Subprograms".
Entry_call_statements, requeue_statements, delay_statements,
accept_statements, select_statements, and abort_statements are
described in 9, "Tasks and Synchronization". Raise_statements are
described in 11, "Exceptions", and code_statements in 13. The remaining
forms of statements are presented in this section.
by:
This section describes the general rules applicable to all statements. Some
statements are discussed in later sections: Procedure_call_statements and
return statements are described in 6, "Subprograms".
Entry_call_statements, requeue_statements, delay_statements,
accept_statements, select_statements, and abort_statements are
described in 9, "Tasks and Synchronization". Raise_statements are
described in 11, "Exceptions", and code_statements in 13. The remaining
forms of statements are presented in this section.
5.1 Simple and Compound Statements - Sequences of Statements
Replace paragraph 4: [AI95-00318-02]
simple_statement ::= null_statement
| assignment_statement | exit_statement
| goto_statement | procedure_call_statement
| return_statement | entry_call_statement
| requeue_statement | delay_statement
| abort_statement | raise_statement
| code_statement
by:
simple_statement ::= null_statement
| assignment_statement | exit_statement
| goto_statement | procedure_call_statement
| simple_return_statement | entry_call_statement
| requeue_statement | delay_statement
| abort_statement | raise_statement
| code_statement
Replace paragraph 5: [AI95-00318-02]
compound_statement ::=
if_statement | case_statement
| loop_statement | block_statement
| accept_statement | select_statement
by:
compound_statement ::=
if_statement | case_statement
| loop_statement | block_statement
| extended_return_statement
| accept_statement | select_statement
Replace paragraph 14: [AI95-00318-02]
A transfer of control is the run-time action of an exit_statement,
return_statement, goto_statement, or requeue_statement,
selection of a terminate_alternative, raising of an exception, or an
abort, which causes the next action performed to be one other than what would
normally be expected from the other rules of the language. As explained in
7.6.1, a transfer of control can cause the execution of constructs to be
completed and then left, which may trigger finalization.
by:
A transfer of control is the run-time action of an exit_statement,
return statement, goto_statement, or requeue_statement,
selection of a terminate_alternative, raising of an exception, or an
abort, which causes the next action performed to be one other than what would
normally be expected from the other rules of the language. As explained in
7.6.1, a transfer of control can cause the execution of constructs to be
completed and then left, which may trigger finalization.
5.2 Assignment Statements
Replace paragraph 4: [AI95-00287-01]
The variable_name of an assignment_statement is expected to be
of any nonlimited type. The expected type for the expression is the type
of the target.
by:
The variable_name of an assignment_statement is expected to be
of any type. The expected type for the expression is the type of the
target.
Replace paragraph 5: [AI95-00287-01]
The target denoted by the variable_name shall be a variable.
by:
The target denoted by the variable_name shall be a variable of a
nonlimited type.
Delete paragraph 16: [AI95-00363-01]
3 The values of the discriminants of an object designated by an
access value cannot be changed (not even by assigning a complete value to the
object itself) since such objects are always constrained; however,
subcomponents of such objects may be unconstrained.
Section 6: Subprograms
6.1 Subprogram Declarations
Replace paragraph 2: [AI95-00218-03]
subprogram_declaration ::= subprogram_specification ;
by:
subprogram_declaration ::=
[overriding_indicator]
subprogram_specification ;
Delete paragraph 3: [AI95-00218-03; AI95-00348-01]
abstract_subprogram_declaration ::= subprogram_specification is abstract;
Replace paragraph 4: [AI95-00348-01]
subprogram_specification ::=
procedure defining_program_unit_name parameter_profile
| function defining_designator parameter_and_result_profile
by:
subprogram_specification ::=
procedure_specification
| function_specification
procedure_specification ::= procedure defining_program_unit_name parameter_profile
function_specification ::= function defining_designator parameter_and_result_profile
Replace paragraph 10: [AI95-00395-01]
The sequence of characters in an operator_symbol shall correspond to an
operator belonging to one of the six classes of operators defined in clause 4.5
(spaces are not allowed and the case of letters is not significant).
by:
The sequence of characters in an operator_symbol shall form a reserved
word, a delimiter, or compound delimiter that corresponds to an operator
belonging to one of the six categories of operators defined in clause 4.5.
Replace paragraph 13: [AI95-00231-01; AI95-00318-02]
parameter_and_result_profile ::= [formal_part] return subtype_mark
by:
parameter_and_result_profile ::=
[formal_part] return [null_exclusion] subtype_mark
| [formal_part] return access_definition
Replace paragraph 15: [AI95-00231-01]
parameter_specification ::=
defining_identifier_list : mode subtype_mark [:= default_expression]
| defining_identifier_list : access_definition [:= default_expression]
by:
parameter_specification ::=
defining_identifier_list : mode [null_exclusion] subtype_mark [:= default_expression]
| defining_identifier_list : access_definition [:= default_expression]
Replace paragraph 20: [AI95-00348-01]
A subprogram_declaration or a generic_subprogram_declaration requires
a completion: a body, a renaming_declaration (see 8.5), or a pragma
Import (see B.1). A completion is not allowed for an
abstract_subprogram_declaration.
by:
A subprogram_declaration or a generic_subprogram_declaration requires
a completion: a body, a renaming_declaration (see 8.5), or a pragma
Import (see B.1). A completion is not allowed for an
abstract_subprogram_declaration (see 3.9.3) or a
null_procedure_declaration (see 6.7).
Replace paragraph 23: [AI95-00231-01; AI95-00318-02]
The nominal subtype of a formal parameter is the subtype denoted by the
subtype_mark, or defined by the access_definition, in the
parameter_specification.
by:
The nominal subtype of a formal parameter is the subtype determined
by the optional null_exclusion and the subtype_mark, or
defined by the access_definition, in the parameter_specification.
The nominal subtype of a function result is the subtype
determined by the optional null_exclusion and the subtype_mark, or
defined by the access_definition, in the parameter_and_result_profile.
Replace paragraph 24: [AI95-00231-01; AI95-00254-01; AI95-00318-02]
An access parameter is a formal in parameter specified by an
access_definition. An access parameter is of an anonymous general
access-to-variable type (see 3.10). Access parameters allow dispatching calls
to be controlled by access values.
by:
An access parameter is a formal in parameter specified by an
access_definition. An access result type is a function result type
specified by an access_definition. An access parameter or result type is
of an anonymous access type (see 3.10). Access parameters of an
access-to-object type allow dispatching calls to
be controlled by access values. Access parameters of an access-to-subprogram
type permit calls to subprograms passed as parameters irrespective of their
accessibility level.
Replace paragraph 27: [AI95-00254-01]
-
For any access parameters, the designated subtype of the parameter
type.
by:
-
For any access parameters of an access-to-object type, the designated
subtype of the parameter type.
-
For any access parameters of an access-to-subprogram type, the
subtypes of the profile of the parameter type.
Replace paragraph 28: [AI95-00231-01; AI95-00254-01; AI95-00318-02]
-
For any result, the result subtype.
by:
-
For any non-access result, the nominal subtype of the function result.
-
For any access result type of an access-to-object type, the
designated subtype of the result type.
-
For any access result type of an access-to-subprogram type, the
subtypes of the profile of the result type.
Replace paragraph 30: [AI95-00218-01; AI95-00348-01]
A subprogram declared by an abstract_subprogram_declaration is abstract;
a subprogram declared by a subprogram_declaration is not. See 3.9.3,
"Abstract Types and Subprograms".
by:
A subprogram declared by an abstract_subprogram_declaration is abstract;
a subprogram declared by a subprogram_declaration is not. See 3.9.3,
"Abstract Types and Subprograms". Similarly, a procedure defined by a
null_procedure_declaration is a null procedure; a procedure declared by
a subprogram_declaration is not. See 6.7, "Null Procedures".
An overriding_indicator is used to indicate whether overriding is
intended. See 8.3.1, "Overriding Indicators".
Replace paragraph 31: [AI95-00348-01]
The elaboration of a subprogram_declaration or an
abstract_subprogram_declaration has no effect.
by:
The elaboration of a subprogram_declaration has no effect.
6.3 Subprogram Bodies
Replace paragraph 2: [AI95-00218-03]
subprogram_body ::=
subprogram_specification is
declarative_part
begin
handled_sequence_of_statements
end [designator];
by:
subprogram_body ::=
[overriding_indicator]
subprogram_specification is
declarative_part
begin
handled_sequence_of_statements
end [designator];
6.3.1 Conformance Rules
Replace paragraph 10: [AI95-00252-01; AI95-00407-01]
-
a subprogram declared immediately within a protected_body.
by:
-
a subprogram declared immediately within a protected_body;
-
any prefixed view of a subprogram (see 4.1.3).
Insert after paragraph 13: [AI95-00254-01; AI95-00409-01]
-
The default calling convention is entry for an entry.
the new paragraph:
-
The calling convention for an anonymous access-to-subprogram parameter
or anonymous access-to-subprogram result is protected if the reserved word
protected appears in its definition and otherwise is the convention of the
subprogram that contains the parameter.
Replace paragraph 15: [AI95-00409-01]
Two profiles are type conformant if they have the same number of
parameters, and both have a result if either does, and corresponding parameter
and result types are the same, or, for access parameters, corresponding
designated types are the same.
by:
Two profiles are type conformant if they have the same number of
parameters, and both have a result if either does, and corresponding parameter
and result types are the same, or, for access parameters or access results,
corresponding designated types are the same, or corresponding designated
profiles are type conformant.
Replace paragraph 16: [AI95-00318-02; AI95-00409-01]
Two profiles are mode conformant if they are type-conformant, and
corresponding parameters have identical modes, and, for access parameters, the
designated subtypes statically match.
by:
Two profiles are mode conformant if they are type-conformant, and
corresponding parameters have identical modes, and, for access parameters or
access result types, the designated subtypes statically match, or the
designated profiles are subtype conformant.
Insert after paragraph 24: [AI95-00345-01; AI95-00397-01]
Two discrete_subtype_definitions are fully conformant if they are
both subtype_indications or are both ranges, the subtype_marks
(if any) denote the same subtype, and the corresponding simple_expressions
of the ranges (if any) fully conform.
the new paragraph:
The prefixed view profile of a subprogram is the profile obtained by
omitting the first parameter of that subprogram. There is no prefixed view
profile for a parameterless subprogram. For the purposes of defining subtype
and mode conformance, the convention of a prefixed view profile is considered
to match that of either an entry or a protected operation.
6.3.2 Inline Expansion of Subprograms
Insert after paragraph 6: [AI95-00309-01]
For each call, an implementation is free to follow or to ignore the
recommendation expressed by the pragma.
the new paragraph:
An implementation may allow a pragma Inline that has an argument which
is a direct_name denoting a subprogram_body of the same
declarative_part.
6.4 Subprogram Calls
Replace paragraph 8: [AI95-00310-01]
The name or prefix given in a procedure_call_statement shall
resolve to denote a callable entity that is a procedure, or an entry renamed as
(viewed as) a procedure. The name or prefix given in a
function_call shall resolve to denote a callable entity that is a
function. When there is an actual_parameter_part, the prefix can be
an implicit_dereference of an access-to-subprogram value.
by:
The name or prefix given in a procedure_call_statement shall
resolve to denote a callable entity that is a procedure, or an entry renamed as
(viewed as) a procedure. The name or prefix given in a
function_call shall resolve to denote a callable entity that is a
function. The name or prefix shall not resolve to denote an abstract
subprogram unless it is also a dispatching subprogram. When there is an
actual_parameter_part, the prefix can be an implicit_dereference
of an access-to-subprogram value.
Insert after paragraph 10: [AI95-00397-01; AI95-00407-01]
For the execution of a subprogram call, the name or prefix of the
call is evaluated, and each parameter_association is evaluated (see
6.4.1). If a default_expression is used, an implicit
parameter_association is assumed for this rule. These evaluations are done
in an arbitrary order. The subprogram_body is then executed. Finally, if
the subprogram completes normally, then after it is left, any necessary
assigning back of formal to actual parameters occurs (see 6.4.1).
the new paragraphs:
If the name or prefix of a subprogram call denotes an inherited
subprogram implemented by an entry or protected subprogram (see 9.1 and
9.4), the subprogram call is equivalent to a call on the underlying entry
or protected subprogram, with the target object being given by the first
actual parameter of the call, and the actual parameters of the entry or
protected subprogram being given by the remaining actual parameters of the
call, if any.
If the name or prefix of a subprogram call denotes a prefixed view
(see 4.1.3), the subprogram call is equivalent to a call on the underlying
subprogram, with the first actual parameter being provided by the prefix
of the prefixed view (or the Access attribute of this prefix if the first
formal parameter is an access parameter), and the remaining actual parameters
given by the actual_parameter_part, if any.
Replace paragraph 11: [AI95-00318-02]
The exception Program_Error is raised at the point of a function_call if
the function completes normally without executing a return_statement.
by:
The exception Program_Error is raised at the point of a function_call if
the function completes normally without executing a return statement.
Replace paragraph 12: [AI95-00231-01]
A function_call denotes a constant, as defined in 6.5; the nominal subtype
of the constant is given by the result subtype of the function.
by:
A function_call denotes a constant, as defined in 6.5; the nominal subtype
of the constant is given by the nominal subtype of the function result.
6.5 Return Statements
Replace paragraph 1: [AI95-00318-02]
A return_statement is used to complete the execution of the
innermost enclosing subprogram_body, entry_body, or
accept_statement.
by:
A simple_return_statement or extended_return_statement (collectively
called a return statement) is used to complete the execution of the
innermost enclosing subprogram_body, entry_body, or
accept_statement.
Replace paragraph 2: [AI95-00318-02]
return_statement ::= return [expression];
by:
simple_return_statement ::= return [expression];
extended_return_statement ::=
return identifier : [aliased] return_subtype_indication [:= expression] [do
handled_sequence_of_statements
end return];
return_subtype_indication ::= subtype_indication | access_definition
Replace paragraph 3: [AI95-00318-02]
The expression, if any, of a return_statement is called the return
expression. The result subtype of a function is the subtype denoted by the
subtype_mark after the reserved word return in the profile of the
function. The expected type for a return expression is the result type of the
corresponding function.
by:
The result subtype of a function is the subtype denoted by the
subtype_mark, or defined by the access_definition, after the reserved
word return in the profile of the function. The expected type for the
expression, if any, of a simple_return_statement is the result
type of the corresponding function.
The expected type for the expression of an extended_return_statement
is that of the return_subtype_indication.
Replace paragraph 4: [AI95-00318-02]
A return_statement shall be within a callable construct, and it applies
to the innermost one. A return_statement shall not be within a body that
is within the construct to which the return_statement applies.
by:
A return statement shall be within a callable construct, and it applies
to the innermost callable construct or extended_return_statement that
contains it. A return statement shall not be within a body that is within
the construct to which the return statement applies.
Replace paragraph 5: [AI95-00318-02; AI95-00416-01]
A function body shall contain at least one return_statement that applies
to the function body, unless the function contains code_statements. A
return_statement shall include a return expression if and only if
it applies to a function body.
by:
A function body shall contain at least one return statement that applies
to the function body, unless the function contains code_statements. A
simple_return_statement shall include an expression if and only if
it applies to a function body. An extended_return_statement shall apply to
a function body.
If the result subtype of a function is defined by a subtype_mark, the
return_subtype_indication of an extended_return_statement that
applies to the function body shall be a subtype_indication. The type of
the subtype_indication shall be the result type of the function. If the
result subtype of the function is constrained, then the subtype defined by the
subtype_indication shall also be constrained and shall statically match
this result subtype. If the result subtype of the function is unconstrained,
then the subtype defined by the subtype_indication shall be a definite
subtype, or there shall be an expression.
If the result subtype of the function is defined by an access_definition,
the return_subtype_indication shall be an access_definition. The
subtype defined by the access_definition shall statically match the result
subtype of the function. The accessibility level of this anonymous access
subtype is that of the result subtype.
If the result subtype of the function is limited, then the expression of
the return statement (if any) shall be an aggregate, a function call (or
equivalent use of an operator), or a qualified_expression or parenthesized
expression whose operand is one of these.
If the result subtype of the function is class-wide, the accessibility level of
the type of the expression of the return statement shall not be statically
deeper than that of the master that elaborated the function body. If the result
subtype has one or more unconstrained access discriminants, the accessibility
level of the anonymous access type of each access discriminant, as determined
by the expression of the simple_return_statement or the
return_subtype_indication, shall not be
statically deeper than that of the master that elaborated the function body.
Within an extended_return_statement, the return object is declared
with the given identifier, with the nominal subtype defined by the
return_subtype_indication.
Replace paragraph 6: [AI95-00318-02; AI95-00416-01]
For the execution of a return_statement, the expression (if any) is
first evaluated and converted to the result subtype.
by:
For the execution of an extended_return_statement, the
subtype_indication or access_definition is elaborated. This creates
the nominal subtype of the return object. If there is an expression,
it is evaluated and converted to the nominal subtype (which might raise
Constraint_Error — see 4.6); the return object is created and the
converted value becomes the initial value of the return object; otherwise, the
return object is created and
initialized by default as for a stand-alone object of its nominal subtype
(see 3.3.1). If the nominal subtype is indefinite, the return object is
constrained by its initial value. The handled_sequence_of_statements, if
any, is then executed.
For the execution of a simple_return_statement, the expression
(if any) is first evaluated and converted to the result subtype to become
the value of the anonymous return object.
If the return object has any parts that are tasks, the activation
of those tasks does not occur until after the function returns (see 9.2).
Delete paragraph 7: [AI95-00318-02]
If the result type is class-wide, then the tag of the result is the tag of the
value of the expression.
Replace paragraph 8: [AI95-00318-02]
If the result type is a specific tagged type:
by:
If the result type of a function is a specific tagged type, the
tag of the return object is that of the result type.
Delete paragraph 9: [AI95-00318-02]
-
If it is limited, then a check is made that the tag of the value of
the return expression identifies the result type. Constraint_Error is raised
if this check fails.
Delete paragraph 10: [AI95-00318-02]
-
If it is nonlimited, then the tag of the result is that of the result
type.
Delete paragraph 11: [AI95-00318-02]
A type is a return-by-reference type if it is a descendant of one of the
following:
Delete paragraph 12: [AI95-00318-02]
Delete paragraph 13: [AI95-00318-02]
-
a task or protected type;
Delete paragraph 14: [AI95-00318-02]
-
a nonprivate type with the reserved word limited in its
declaration;
Delete paragraph 15: [AI95-00318-02]
-
a composite type with a subcomponent of a return-by-reference type;
Delete paragraph 16: [AI95-00318-02]
-
a private type whose full type is a return-by-reference type.
Delete paragraph 17: [AI95-00318-02]
If the result type is a return-by-reference type, then a check is made that the
return expression is one of the following:
Delete paragraph 18: [AI95-00162-01; AI95-00316-01; AI95-00318-02]
-
a name that denotes an object view whose accessibility level is
not deeper than that of the master that elaborated the function body; or
Delete paragraph 19: [AI95-00318-02]
-
a parenthesized expression or qualified_expression whose operand
is one of these kinds of expressions.
Replace paragraph 20: [AI95-00318-02; AI95-00344-01; AI95-00402-01; AI95-00416-01]
The exception Program_Error is raised if this check fails.
by:
If the result type is class-wide, a check is made that the accessibility level
of the type identified by the tag of the result is not deeper than that of the
master that elaborated the function body. If the result subtype has one or more
unconstrained access discriminants, a check is made that the accessibility
level of the anonymous access type of each access discriminant, as determined
by the expression of the simple_return_statement or the
return_subtype_indication, is not deeper than
that of the master that elaborated the function body. If either check fails,
Program_Error is raised.
Delete paragraph 21: [AI95-00318-02]
For a function with a return-by-reference result type the result is returned by
reference; that is, the function call denotes a constant view of the object
associated with the value of the return expression. For any other function, the
result is returned by copy; that is, the converted value is assigned into an
anonymous constant created at the point of the return_statement, and the
function call denotes that object.
Replace paragraph 22: [AI95-00318-02; AI95-00416-01]
Finally, a transfer of control is performed which completes the
execution of the callable construct to which the return_statement applies,
and returns to the caller.
by:
Finally, a transfer of control is performed which completes the
execution of the construct to which the return statement applies,
and returns to the caller. In the case of a function, the
function_call denotes a constant view of the return object.
Implementation Permissions
If the result subtype of a function is unconstrained,
and a call on the function is used to provide the initial value of
an object with a constrained nominal subtype, Constraint_Error may
be raised at the point of the call (after abandoning the
execution of the function body) if, while elaborating a
return_subtype_indication or evaluating the expression of a return
statement within the function, it is determined that the value of the
result will violate the constraint of this object's subtype.
Replace paragraph 24: [AI95-00318-02]
return; -- in a procedure body, entry_body, or accept_statement
return Key_Value(Last_Index); -- in a function body
by:
return; -- in a procedure body, entry_body,
-- accept_statement, or extended_return_statement
return Key_Value(Last_Index); -- in a function body
return Node : Cell do -- in a function body, see 3.10.1 for Cell
Node.Value := Result;
Node.Succ := Next_Node;
end return;
6.5.1 Pragma No_Return
Insert new clause: [AI95-00329-01; AI95-00414-01; AI95-00433-01]
A pragma No_Return indicates that a procedure cannot return normally;
it may propagate an exception or loop forever.
The form of a pragma No_Return, which is a representation pragma (see
13.1), is as follows:
pragma No_Return(procedure_local_name{, procedure_local_name});
Each procedure_local_name shall denote one or more procedures or
generic procedures; the denoted entities are non-returning.
The procedure_local_name shall not denote a null procedure nor
an instance of a generic unit.
A return statement shall not apply to a non-returning procedure or generic
procedure.
A procedure shall be non-returning if it overrides a dispatching
non-returning procedure. In addition to the places where Legality
Rules normally apply (see 12.3), this rule applies also in the private
part of an instance of a generic unit.
If a renaming-as-body completes a non-returning procedure declaration,
then the renamed procedure shall be non-returning.
If a generic procedure is non-returning, then so are its instances.
If a procedure declared within a generic unit is non-returning,
then so are the corresponding copies of that procedure in instances.
If the body of a non-returning procedure completes normally,
Program_Error is raised at the point of the call.
procedure Fail(Msg : String); -- raises Fatal_Error exception
pragma No_Return(Fail);
-- Inform compiler and reader that procedure never returns normally
6.7 Null Procedures
Insert new clause: [AI95-00348-01; AI95-00433-01]
A null_procedure_declaration provides a shorthand to declare a procedure
with an empty body.
null_procedure_declaration ::=
[overriding_indicator]
procedure_specification is null;
A null_procedure_declaration declares a null procedure.
A completion is not allowed for a null_procedure_declaration.
The execution of a null procedure is invoked by a subprogram call.
For the execution of a subprogram call on a null procedure, the execution of
the subprogram_body has no effect.
The elaboration of a null_procedure_declaration has no effect.
procedure Simplify(Expr : in out Expression) is null; -- see 3.9
-- By default, Simplify does nothing, but it may be overridden in extensions of Expression
Section 7: Packages
7.3 Private Types and Private Extensions
Replace paragraph 2: [AI95-00251-01; AI95-00419-01]
private_extension_declaration ::=
type defining_identifier [discriminant_part] is
[abstract] new ancestor_subtype_indication with private;
by:
private_extension_declaration ::=
type defining_identifier [discriminant_part] is
[abstract] [limited] new ancestor_subtype_indication [and interface_list] with private;
Replace paragraph 6: [AI95-00419-01]
A private type is limited if its declaration includes the reserved word
limited; a private extension is limited if its ancestor type is limited. If
the partial view is nonlimited, then the full view shall be nonlimited. If a
tagged partial view is limited, then the full view shall be limited. On the
other hand, if an untagged partial view is limited, the full view may be
limited or nonlimited.
by:
A private type is limited if its declaration includes the reserved
word limited; a private extension is limited if its ancestor type is a
limited type that is not an interface type, or if the reserved word limited
appears in its definition. If the partial view is nonlimited, then the full
view shall be nonlimited. If a tagged partial view is limited, then the full
view shall be limited. On the other hand, if an untagged partial view is
limited, the full view may be limited or nonlimited.
Insert after paragraph 7: [AI95-00396-01]
If the partial view is tagged, then the full view shall be tagged. On the
other hand, if the partial view is untagged, then the full view may be tagged
or untagged. In the case where the partial view is untagged and the full view
is tagged, no derivatives of the partial view are allowed within the immediate
scope of the partial view; derivatives of the full view are allowed.
the new paragraphs:
If a full type has a partial view that is tagged, then:
-
the partial view shall be a synchronized tagged type (see 3.9.4) if
and only if the full type is a synchronized tagged type;
-
the partial view shall be a descendant of an interface type (see 3.9.4)
if and only if the full type is a descendant of the
interface type.
Insert after paragraph 8: [AI95-00419-01]
The ancestor subtype of a private_extension_declaration is the subtype
defined by the ancestor_subtype_indication; the ancestor type shall be a
specific tagged type. The full view of a private extension shall be derived
(directly or indirectly) from the ancestor type. In addition to the places
where Legality Rules normally apply (see 12.3), the requirement that the
ancestor be specific applies also in the private part of an instance of a
generic unit.
the new paragraph:
If the reserved word limited appears in a
private_extension_declaration, the ancestor type shall be a limited type.
Insert after paragraph 10: [AI95-00419-01]
If a private extension inherits known discriminants from the ancestor subtype,
then the full view shall also inherit its discriminants from the ancestor
subtype, and the parent subtype of the full view shall be constrained if and
only if the ancestor subtype is constrained.
the new paragraph:
If the full view of a private extension is limited, then the reserved word
limited shall appear in the full_type_declaration if and only if it
also appears in the private_extension_declaration.
Replace paragraph 16: [AI95-00401-01]
A private extension inherits components (including discriminants unless there
is a new discriminant_part specified) and user-defined primitive
subprograms from its ancestor type, in the same way that a record extension
inherits components and user-defined primitive subprograms from its parent type
(see 3.4).
by:
A private extension inherits components (including discriminants unless there
is a new discriminant_part specified) and user-defined primitive
subprograms from its ancestor type and its progenitor types (if any), in the
same way that a record extension inherits components and user-defined primitive
subprograms from its parent type and its progenitor types (see 3.4).
Replace paragraph 19: [AI95-00318-02]
Declaring a private type with an unknown_discriminant_part is a
way of preventing clients from creating uninitialized objects of the
type; they are then forced to initialize each object by calling some
operation declared in the visible part of the package.
If such a type is also limited, then no objects of the type can
be declared outside the scope of the full_type_declaration, restricting
all object creation to the package defining the type. This allows
complete control over all storage allocation for the type.
Objects of such a type can still be passed as parameters, however.
by:
Declaring a private type with an unknown_discriminant_part is a
way of preventing clients from creating uninitialized objects of the
type; they are then forced to initialize each object by calling some
operation declared in the visible part of the package.
Insert after paragraph 20: [AI95-00401-01]
7 The ancestor type specified in a
private_extension_declaration and the parent type specified in the
corresponding declaration of a record extension given in the private part need
not be the same — the parent type of the full view can be any descendant
of the ancestor type. In this case, for a primitive subprogram that is
inherited from the ancestor type and not overridden, the formal parameter names
and default expressions (if any) come from the corresponding primitive
subprogram of the specified ancestor type, while the body comes from the
corresponding primitive subprogram of the parent type of the full view. See
3.9.2.
the new paragraph:
8 The progenitor types specified in a
private_extension_declaration and the progenitor types specified in the
corresponding declaration of a record extension given in the private part need
not be the same — the only requirement is that the private extension must
be descended from each interface from which the record extension is
descended.
7.3.1 Private Operations
Replace paragraph 12: [AI95-00287-01]
9 Partial views provide assignment (unless the view is limited),
membership tests, selected components for the selection of discriminants and
inherited components, qualification, and explicit conversion.
by:
9 Partial views provide initialization,
membership tests, selected components for the selection of discriminants and
inherited components, qualification, and explicit conversion.
Nonlimited partial views also allow use of assignment_statements.
7.4 Deferred Constants
Replace paragraph 5: [AI95-00385-01]
-
The deferred and full constants shall have the same type;
by:
-
The deferred and full constants shall have the same type, or
shall have statically matching anonymous access subtypes;
Replace paragraph 6: [AI95-00385-01]
-
If the subtype defined by the subtype_indication in the deferred
declaration is constrained, then the subtype defined by the
subtype_indication in the full declaration shall match it statically. On
the other hand, if the subtype of the deferred constant is unconstrained, then
the full declaration is still allowed to impose a constraint. The constant
itself will be constrained, like all constants;
by:
-
If the deferred constant declaration includes a
subtype_indication that defines a constrained subtype, then the subtype
defined by the subtype_indication in the full declaration shall match it
statically. On the other hand, if the subtype of the deferred constant is
unconstrained, then the full declaration is still allowed to impose a
constraint. The constant itself will be constrained, like all constants;
Replace paragraph 9: [AI95-00256-01]
The completion of a deferred constant declaration shall
occur before the constant is frozen (see 7.4).
by:
The completion of a deferred constant declaration shall
occur before the constant is frozen (see 13.14).
7.5 Limited Types
Replace paragraph 1: [AI95-00287-01]
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.
by:
A limited type is (a view of) a type for which copying (such as for an
assignment_statement) is not allowed. A nonlimited type is a (view of a)
type for which copying is allowed.
Replace paragraph 2: [AI95-00287-01; AI95-00318-02; AI95-00419-01]
If a tagged record type has any limited components, then the reserved word
limited shall appear in its record_type_definition.
by:
If a tagged record type has any limited components, then the reserved word
limited shall appear in its record_type_definition. If the reserved
word limited appears in the definition of a type extension, its parent type
and any progenitor interfaces shall be limited.
In the following contexts, an expression of a limited
type is not permitted unless it is an aggregate, a function_call,
or a parenthesized expression or qualified_expression whose operand
is permitted by this rule:
-
the initialization expression of an object_declaration
(see 3.3.1)
-
the default_expression of a component_declaration (see 3.8)
-
the expression of a record_component_association (see 4.3.1)
-
the expression for an ancestor_part of an
extension_aggregate (see 4.3.2)
-
an expression of a positional_array_aggregate or the
expression of an array_component_association (see 4.3.3)
-
the qualified_expression of an initialized allocator (see 4.8)
-
the expression of a return statement (see 6.5)
-
the default_expression or actual parameter for a formal object
of mode in (see 12.4)
Replace paragraph 3: [AI95-00419-01]
A type is limited if it is a descendant of one of the following:
by:
A type is limited if it is one of the following:
Replace paragraph 4: [AI95-00411-01; AI95-00419-01]
-
a type with the reserved word limited in its definition;
by:
-
a type with the reserved word limited, synchronized,
task, or protected in its definition;
Delete paragraph 5: [AI95-00419-01]
-
a task or protected type;
Replace paragraph 6: [AI95-00419-01]
-
a composite type with a limited component.
the new paragraph:
-
a composite type with a limited component;
-
a derived type whose parent is limited and is not an interface.
Insert after paragraph 8: [AI95-00287-01; AI95-00318-02]
There are no predefined equality operators for a limited type.
the new paragraph:
Implementation Requirements
For an aggregate of a limited type used to initialize an object as allowed
above, the implementation shall not create a separate anonymous object for the
aggregate. For a function_call of a type with a part that is of a
task, protected, or explicitly limited record type that is used to initialize
an object as allowed above, the implementation shall not create a separate
return object (see 6.5) for the function_call. The aggregate or
function_call shall be constructed directly in the new object.
Replace paragraph 9: [AI95-00287-01; AI95-00318-02]
13 The following are consequences of the rules for limited types:
by:
13 While it is allowed to write initializations of limited objects,
such initializations never copy a limited object. The source of such an
assignment operation must be an aggregate or function_call, and such
aggregates and function_calls must be built directly in the target
object.
Delete paragraph 10: [AI95-00287-01]
-
An initialization expression is not allowed in an
object_declaration if the type of the object is limited.
Delete paragraph 11: [AI95-00287-01]
-
A default expression is not allowed in a
component_declaration if the type of the record component is limited.
Delete paragraph 12: [AI95-00287-01]
-
An initialized allocator is not allowed if the designated type is
limited.
Delete paragraph 13: [AI95-00287-01]
-
A generic formal parameter of mode in must not be of a limited
type.
Delete paragraph 14: [AI95-00287-01]
14 Aggregates are not available for a limited composite type.
Concatenation is not available for a limited array type.
Delete paragraph 15: [AI95-00287-01]
15 The rules do not exclude a default_expression for a formal
parameter of a limited type; they do not exclude a deferred constant of a
limited type if the full declaration of the constant is of a nonlimited type.
7.6 User-Defined Assignment and Finalization
Replace paragraph 5: [AI95-00161-01]
type Controlled is abstract tagged private;
by:
type Controlled is abstract tagged private;
pragma Preelaborable_Initialization(Controlled);
Replace paragraph 6: [AI95-00348-01]
procedure Initialize (Object : in out Controlled);
procedure Adjust (Object : in out Controlled);
procedure Finalize (Object : in out Controlled);
by:
procedure Initialize (Object : in out Controlled) is null;
procedure Adjust (Object : in out Controlled) is null;
procedure Finalize (Object : in out Controlled) is null;
Replace paragraph 7: [AI95-00161-01]
type Limited_Controlled is abstract tagged limited private;
by:
type Limited_Controlled is abstract tagged limited private;
pragma Preelaborable_Initialization(Limited_Controlled);
Replace paragraph 8: [AI95-00348-01]
procedure Initialize (Object : in out Limited_Controlled);
procedure Finalize (Object : in out Limited_Controlled);
private
... -- not specified by the language
end Ada.Finalization;
by:
procedure Initialize (Object : in out Limited_Controlled) is null;
procedure Finalize (Object : in out Limited_Controlled) is null;
private
... -- not specified by the language
end Ada.Finalization;
Replace paragraph 9: [AI95-00348-01; AI95-00360-01]
A controlled type is a descendant of Controlled or Limited_Controlled. The
(default) implementations of Initialize, Adjust, and Finalize have no effect.
The predefined "=" operator of type Controlled always returns True, since this
operator is incorporated into the implementation of the predefined equality
operator of types derived from Controlled, as explained in 4.5.2. The type
Limited_Controlled is like Controlled, except that it is limited and it lacks
the primitive subprogram Adjust.
by:
A controlled type is a descendant of Controlled or Limited_Controlled. The
predefined "=" operator of type Controlled always returns True, since this
operator is incorporated into the implementation of the predefined equality
operator of types derived from Controlled, as explained in 4.5.2. The type
Limited_Controlled is like Controlled, except that it is limited and it lacks
the primitive subprogram Adjust.
A type is said to need finalization if:
-
it is a controlled type, a task type or a protected type; or
-
it has a component that needs finalization; or
-
it is a limited type that has an access discriminant whose designated
type needs finalization; or
-
it is one of a number of language-defined types that are explicitly
defined to need finalization.
Replace paragraph 10: [AI95-00373-01]
During the elaboration of an object_declaration, for every controlled
subcomponent of the object that is not assigned an initial value (as defined in
3.3.1), Initialize is called on that subcomponent. Similarly, if the object as
a whole is controlled and is not assigned an initial value, Initialize is
called on the object. The same applies to the evaluation of an allocator,
as explained in 4.8.
by:
During the elaboration or evaluation of a construct that causes an object to
be initialized by default, for every controlled subcomponent of the object
that is not assigned an initial value (as defined in 3.3.1), Initialize is
called on that subcomponent. Similarly, if the object that is initialized by
default as a whole is controlled, Initialize is called on the object.
Replace paragraph 11: [AI95-00373-01]
For an extension_aggregate whose ancestor_part is a subtype_mark,
for each controlled subcomponent of the ancestor part, either Initialize is
called, or its initial value is assigned, as appropriate Initialize is called
on all controlled subcomponents of the ancestor part; if the type of the
ancestor part is itself controlled, the Initialize procedure of the ancestor
type is called, unless that Initialize procedure is abstract.
by:
For an extension_aggregate whose ancestor_part is a subtype_mark,
if the type of the ancestor_part is controlled, the Initialize procedure
of the ancestor type is called, unless that Initialize procedure is abstract.
Replace paragraph 17.1: [AI95-00318-02]
For an aggregate of a controlled type whose value is assigned,
other than by an assignment_statement or a
return_statement, the implementation shall not create a separate
anonymous object for the aggregate. The aggregate value shall be
constructed directly in the target of the assignment operation and Adjust is
not called on the target object.
by:
For an aggregate of a controlled type whose value is assigned,
other than by an assignment_statement or a
simple_return_statement of a return type with no part that is of a task,
protected, or explicitly limited record type, the implementation shall not
create a separate
anonymous object for the aggregate. The aggregate value shall be
constructed directly in the target of the assignment operation and Adjust is
not called on the target object.
Replace paragraph 21: [AI95-00147-01]
-
For an aggregate or function call whose value is assigned into a target object,
the implementation need not create a separate anonymous object if it can safely
create the value of the aggregate or function call directly in the target
object. Similarly, for an assignment_statement, the implementation need not
create an anonymous object if the value being assigned is the result of
evaluating a name denoting an object (the source object) whose storage cannot
overlap with the target. If the source object might overlap with the target
object, then the implementation can avoid the need for an intermediary
anonymous object by exercising one of the above permissions and perform the
assignment one component at a time (for an overlapping array assignment), or
not at all (for an assignment where the target and the source of the assignment
are the same object). Even if an anonymous object is created, the
implementation may move its value to the target object as part of the
assignment without re-adjusting so long as the anonymous object has no aliased
subcomponents.
by:
-
For an aggregate or function call whose value is assigned into a target object,
the implementation need not create a separate anonymous object if it can safely
create the value of the aggregate or function call directly in the target
object. Similarly, for an assignment_statement, the implementation need not
create an anonymous object if the value being assigned is the result of
evaluating a name denoting an object (the source object) whose storage cannot
overlap with the target. If the source object might overlap with the target
object, then the implementation can avoid the need for an intermediary
anonymous object by exercising one of the above permissions and perform the
assignment one component at a time (for an overlapping array assignment), or
not at all (for an assignment where the target and the source of the assignment
are the same object).
Furthermore, an implementation is permitted to omit implicit
Initialize, Adjust, and Finalize calls and associated assignment
operations on an object of a nonlimited controlled type provided that:
-
any omitted Initialize call is not a call on a user-defined Initialize
procedure, and
-
any usage of the value of the object after the implicit Initialize or
Adjust call and before any subsequent Finalize call on the object
does not change the external effect of the program, and
-
after the omission of such calls and operations, any execution of
the program that executes an Initialize or Adjust call on an object
or initializes an object by an aggregate will also later execute a
Finalize call on the object and will always do so prior to assigning
a new value to the object, and
-
the assignment operations associated with omitted Adjust calls are
also omitted.
This permission applies to Adjust and Finalize calls even if the
implicit calls have additional external effects.
7.6.1 Completion and Finalization
Replace paragraph 2: [AI95-00318-02]
The execution of a construct or entity is complete when the end of that
execution has been reached, or when a transfer of control (see 5.1) causes it
to be abandoned. Completion due to reaching the end of
execution, or due to the transfer of control of an exit_, return_,
goto_, or requeue_statement or of the selection of a
terminate_alternative is normal completion. Completion is
abnormal otherwise — when control is transferred out
of a construct due to abort or the raising of an exception.
by:
The execution of a construct or entity is complete when the end of that
execution has been reached, or when a transfer of control (see 5.1) causes it
to be abandoned. Completion due to reaching the end of
execution, or due to the transfer of control of an exit_statement,
return statement, goto_statement, or requeue_statement or of the
selection of a terminate_alternative is normal completion. Completion
is abnormal otherwise — when control is transferred out of a construct due
to abort or the raising of an exception.
Replace paragraph 3: [AI95-00162-01; AI95-00416-01]
After execution of a construct or entity is complete, it is left, meaning
that execution continues with the next action, as defined for the execution
that is taking place. Leaving an execution happens immediately after its
completion, except in the case of a master: the execution of a task_body,
a block_statement, a subprogram_body, an entry_body, or an
accept_statement. A master is finalized after it is complete, and before
it is left.
by:
After execution of a construct or entity is complete, it is left, meaning
that execution continues with the next action, as defined for the execution
that is taking place. Leaving an execution happens immediately after its
completion, except in the case of a master: the execution of a body other than
a package_body; the execution of a statement; or
the evaluation of an expression or range that is not part of an
enclosing expression, range, or simple_statement. A master is
finalized after it is complete, and before it is left.
Replace paragraph 9: [AI95-00416-01]
-
If the object is of a composite type, then after performing the above
actions, if any, every component of the object is finalized in an arbitrary
order, except as follows: if the object has a component with an access
discriminant constrained by a per-object expression, this component is
finalized before any components that do not have such discriminants; for an
object with several components with such a discriminant, they are finalized in
the reverse of the order of their component_declarations.
by:
-
If the object is of a composite type, then after performing the above
actions, if any, every component of the object is finalized in an arbitrary
order, except as follows: if the object has a component with an access
discriminant constrained by a per-object expression, this component is
finalized before any components that do not have such discriminants; for an
object with several components with such a discriminant, they are finalized in
the reverse of the order of their component_declarations;
-
If the object has coextensions (see 3.10.2), each coextension is
finalized after the object whose access discriminant designates it.
Replace paragraph 11: [AI95-00280-01]
The order in which the finalization of a master performs finalization of
objects is as follows: Objects created by declarations in the master are
finalized in the reverse order of their creation. For objects that were
created by allocators for an access type whose ultimate ancestor is
declared in the master, this rule is applied as though each such object that
still exists had been created in an arbitrary order at the first freezing
point (see 13.14) of the ultimate ancestor type.
by:
The order in which the finalization of a master performs finalization of
objects is as follows: Objects created by declarations in the master are
finalized in the reverse order of their creation. For objects that were
created by allocators for an access type whose ultimate ancestor is
declared in the master, this rule is applied as though each such object that
still exists had been created in an arbitrary order at the first freezing
point (see 13.14) of the ultimate ancestor type; the finalization of these
objects is called the finalization of the collection.
Replace paragraph 12: [AI95-00256-01]
The target of an assignment statement is finalized before copying in the
new value, as explained in 7.6.
by:
The target of an assignment_statement is finalized before copying in the
new value, as explained in 7.6.
Replace paragraph 13: [AI95-00162-01]
If the object_name in an object_renaming_declaration, or the actual
parameter for a generic formal in out parameter in a
generic_instantiation, denotes any part of an anonymous object created by
a function call, the anonymous object is not finalized until after
it is no longer accessible via any name. Otherwise, an anonymous
object created by a function call or by an aggregate is finalized no later
than the end of the innermost enclosing declarative_item or
statement; if that is a compound_statement, the object is finalized
before starting the execution of any statement within the
compound_statement.
by:
The master of an object is the master enclosing its creation whose
accessibility level (see 3.10.2) is equal to that of the object.
Replace paragraph 13.1: [AI95-00162-01]
If a transfer of control or raising of an exception occurs prior to performing
a finalization of an anonymous object, the anonymous object is finalized as
part of the finalizations due to be performed for the object's innermost
enclosing master.
by:
In the case of a potentially blocking operation that is a master,
finalization of an (anonymous) object occurs before blocking if the last use of
the object occurs before blocking. In particular, for a delay_statement,
any finalization occurs before delaying the task.
In the case of an expression that is a master,
finalization of any (anonymous) objects occurs as the final part of
evaluation of the expression.
Replace paragraph 16: [AI95-00256-01]
-
For an Adjust invoked as part of the initialization of a controlled
object, other adjustments due to be performed might or might not be performed,
and then Program_Error is raised. During its propagation, finalization might or
might not be applied to objects whose Adjust failed. For an Adjust invoked
as part of an assignment statement, any other adjustments due to be performed
are performed, and then Program_Error is raised.
by:
-
For an Adjust invoked as part of assignment operations other than
those invoked as part of an assignment_statement, other adjustments due to
be performed might or might not be performed, and then Program_Error is raised.
During its propagation, finalization might or might not be applied to objects
whose Adjust failed. For an Adjust invoked as part of an
assignment_statement, any other adjustments due to be performed are
performed, and then Program_Error is raised.
Replace paragraph 18: [AI95-00318-02]
For a Finalize invoked by the transfer of control of an exit_,
return_, goto_, or requeue_statement, Program_Error is raised no
earlier than after the finalization of the master being finalized when the
exception occurred, and no later than the point where normal execution would
have continued. Any other finalizations due to be performed up to that point
are performed before raising Program_Error.
by:
For a Finalize invoked by the transfer of control of an exit_statement,
return statement, goto_statement, or requeue_statement, Program_Error
is raised no earlier than after the finalization of the master being finalized
when the exception occurred, and no later than the point where normal execution
would have continued. Any other finalizations due to be performed up to that
point are performed before raising Program_Error.
Section 8: Visibility Rules
8.1 Declarative Region
Insert after paragraph 4: [AI95-00318-02]
the new paragraph:
-
an extended_return_statement;
8.2 Scope of Declarations
Insert after paragraph 10: [AI95-00408-01]
The scope of a declaration always contains the immediate scope of the
declaration. In addition, for a given declaration that occurs immediately
within the visible part of an outer declaration, or is a public child of an
outer declaration, the scope of the given declaration extends to the end of the
scope of the outer declaration, except that the scope of a library_item
includes only its semantic dependents.
the new paragraph:
The scope of an attribute_definition_clause is identical to the scope of a
declaration that would occur at the point of the
attribute_definition_clause.
8.3 Visibility
Insert after paragraph 12: [AI95-00251-01]
-
An implicit declaration of an inherited subprogram overrides a
previous implicit declaration of an inherited subprogram.
the new paragraphs:
-
If two or more homographs are implicitly declared at the same place:
-
If one is a non-null non-abstract subprogram, then it overrides
those that are null or abstract subprograms.
-
If all are null procedures or abstract subprograms, then any null
procedure overrides all abstract subprograms; if more than one such homograph
remains that is not thus overridden, then one is chosen arbitrarily to override
the others.
Replace paragraph 20: [AI95-00217-06; AI95-00412-01]
-
The declaration of a library unit (including a
library_unit_renaming_declaration) is hidden from all visibility except at
places that are within its declarative region or within the scope of a
with_clause that mentions it. For each declaration or renaming of a generic
unit as a child of some parent generic package, there is a corresponding
declaration nested immediately within each instance of the parent. Such a
nested declaration is hidden from all visibility except at places that are
within the scope of a with_clause that mentions the child.
by:
-
The declaration of a library unit (including a
library_unit_renaming_declaration) is hidden from all visibility at
places outside its declarative region that are not within the scope of a
nonlimited_with_clause that mentions it. The limited view of a library
package is hidden from all visibility at places that are not within the scope
of a limited_with_clause that mentions it; in addition, the limited view
is hidden from all visibility within the declarative region of the package, as
well as within the scope of any nonlimited_with_clause that mentions the
package. Where the declaration of the limited view of a
package is visible, any name that denotes the package denotes the
limited view, including those provided by a package renaming.
-
For each declaration or renaming of a generic unit as a child of some
parent generic package, there is a corresponding declaration nested immediately
within each instance of the parent. Such a nested declaration is hidden from
all visibility except at places that are within the scope of a with_clause
that mentions the child.
Insert after paragraph 23: [AI95-00195-01; AI95-00408-01]
-
A declaration is also hidden from direct visibility where hidden from
all visibility.
the new paragraph:
An attribute_definition_clause is visible everywhere within its scope.
Replace paragraph 26: [AI95-00251-01; AI95-00377-01]
A non-overridable declaration is illegal if there is a homograph occurring
immediately within the same declarative region that is visible at the place of
the declaration, and is not hidden from all visibility by the non-overridable
declaration. In addition, a type extension is illegal if somewhere within its
immediate scope it has two visible components with the same name. Similarly,
the context_clause for a subunit is illegal if it mentions (in a
with_clause) some library unit, and there is a homograph of the library
unit that is visible at the place of the corresponding stub, and the homograph
and the mentioned library unit are both declared immediately within the same
declarative region. These rules also apply to dispatching operations declared
in the visible part of an instance of a generic unit. However, they do not
apply to other overloadable declarations in an instance; such declarations may
have type conformant profiles in the instance, so long as the corresponding
declarations in the generic were not type conformant.
by:
A non-overridable declaration is illegal if there is a homograph occurring
immediately within the same declarative region that is visible at the place of
the declaration, and is not hidden from all visibility by the non-overridable
declaration. In addition, a type extension is illegal if somewhere within its
immediate scope it has two visible components with the same name. Similarly,
the context_clause for a compilation unit is illegal if it mentions (in a
with_clause) some library unit, and there is a homograph of the library
unit that is visible at the place of the compilation unit, and the homograph
and the mentioned library unit are both declared immediately within the same
declarative region.
If two or more homographs are implicitly declared at the same place (and not
overridden by a non-overridable declaration) then at most one shall be a
non-null non-abstract subprogram. If all are null procedures or abstract
subprograms, then all of the null procedures shall be fully conformant with
one another. If all are abstract subprograms, then all of the subprograms
shall be fully conformant with one another.
All of the above Legality Rules also apply to dispatching operations declared
in the visible part of an instance of a generic unit. However, they do not
apply to other overloadable declarations in an instance; such declarations may
have type conformant profiles in the instance, so long as the corresponding
declarations in the generic were not type conformant.
8.3.1 Overriding Indicators
Insert new clause: [AI95-00218-01; AI95-00348-01; AI95-00397-01; AI95-00433-01]
An overriding_indicator is used to declare that an operation is
intended to override (or not override) an inherited operation.
overriding_indicator ::= [not] overriding
If an abstract_subprogram_declaration,
null_procedure_declaration,
subprogram_body, subprogram_body_stub,
subprogram_renaming_declaration, or generic_instantiation of a
subprogram, or
subprogram_declaration other than a protected subprogram
has an overriding_indicator, then:
-
the operation shall be a primitive operation for some type;
-
if the overriding_indicator is overriding, then the operation
shall override a homograph at the point of the declaration or body;
-
if the overriding_indicator is not overriding, then the
operation shall not override any homograph (at any point).
In addition to the places where Legality Rules normally apply, these rules also
apply in the private part of an instance of a generic unit.
The use of overriding_indicators allow the detection of errors at
compile-time that otherwise might not be detected at all. For instance, we
might declare a security queue derived from the Queue interface of 3.9.4 as:
type Security_Queue is new Queue with record ...;
overriding
procedure Append (Q : in out Security_Queue; Element : in Person_Name);
overriding
procedure Remove_First (Q : in out Security_Queue; Element : in Person_Name);
overriding
function Cur_Count (Q : in Security_Queue) return Natural;
overriding
function Max_Count (Q : in Security_Queue) return Natural;
not overriding
procedure Arrest (Q : in out Security_Queue; Element : in Person_Name);
The first four subprogram declarations guarantees that these subprograms will
override the four subprograms inherited from the Queue interface. If a spelling
error occurs in one of these declarations, an error will occur. Similarly, the
declaration of Arrest guarantees that this is a new operation.
8.4 Use Clauses
Replace paragraph 5: [AI95-00217-06]
A package_name of a use_package_clause shall denote a package.
by:
A package_name of a use_package_clause shall denote a nonlimited view of a
package.
Insert after paragraph 7: [AI95-00217-06]
For a use_clause immediately within a declarative region, the scope is the
portion of the declarative region starting just after the use_clause and
extending to the end of the declarative region. However, the scope of a
use_clause in the private part of a library unit does not include the
visible part of any public descendant of that library unit.
the new paragraph:
A package is named in a use_package_clause if it is denoted by a
package_name of that clause. A type is named in a
use_type_clause if it is determined by a subtype_mark of that clause.
Replace paragraph 8: [AI95-00217-06]
For each package denoted by a package_name of a
use_package_clause whose scope encloses a place, each declaration that
occurs immediately within the declarative region of the package is
potentially use-visible at this place if the declaration is visible at this
place. For each type T or T'Class determined by a subtype_mark of
a use_type_clause whose scope encloses a place, the declaration of each
primitive operator of type T is potentially use-visible at this place
if its declaration is visible at this place.
by:
For each package named in a use_package_clause whose scope encloses a
place, each declaration that occurs immediately within the declarative region
of the package is potentially use-visible at this place if the declaration
is visible at this place. For each type T or T'Class named in a
use_type_clause whose scope encloses a place, the declaration of each
primitive operator of type T is potentially use-visible at this place
if its declaration is visible at this place.
8.5.1 Object Renaming Declarations
Replace paragraph 2: [AI95-00230-01; AI95-00409-01; AI95-00423-01]
object_renaming_declaration ::=
defining_identifier : subtype_mark renames object_name;
by:
object_renaming_declaration ::=
defining_identifier : [null_exclusion] subtype_mark renames object_name;
| defining_identifier : access_definition renames object_name;
Replace paragraph 3: [AI95-00230-01; AI95-00254-01; AI95-00409-01]
The type of the object_name shall resolve to the type determined by the
subtype_mark.
by:
The type of the object_name shall resolve to the type determined by the
subtype_mark, or in the case where the type is defined by an
access_definition, to an anonymous access type, which in the case
of an access-to-object type shall have the same designated type as that of the
access_definition, and in the case of an access-to-subprogram type shall
have a designated profile that is type conformant with that of the
access_definition.
Replace paragraph 4: [AI95-00231-01; AI95-00254-01; AI95-00409-01; AI95-00423-01]
The renamed entity shall be an object.
by:
The renamed entity shall be an object.
In the case where the type is defined by an access_definition,
the type of the renamed object and the type defined by the access_definition:
-
shall both be access-to-object types with statically matching designated
subtypes and with both or neither being access-to-constant types; or
-
shall both be access-to-subprogram types with subtype conformant
designated profiles.
For an object_renaming_declaration with a null_exclusion or an
access_definition that has a null_exclusion:
-
if the object_renaming_declaration occurs within the body of a
generic unit G or within the body of a generic unit declared within the
declarative region of the generic unit G, and the object_name
denotes a generic formal object of G, then the declaration of that formal
object shall have a null_exclusion;
-
otherwise, the subtype of the object_name shall exclude null.
In addition to the places where Legality Rules normally apply (see 12.3), this
rule applies also in the private part of an instance of a generic unit.
Replace paragraph 5: [AI95-00363-01]
The renamed entity shall not be a subcomponent that depends on
discriminants of a variable whose nominal subtype is unconstrained, unless
this subtype is indefinite, or the variable is aliased. A slice of an array
shall not be renamed if this restriction disallows renaming of the array.
In addition to the places where Legality Rules normally apply, these rules
apply also in the private part of an instance of a generic unit. These rules
also apply for a renaming that appears in the body of a generic unit, with
the additional requirement that even if the nominal subtype of the variable is
indefinite, its type shall not be a descendant of an untagged generic
formal derived type.
by:
The renamed entity shall not be a subcomponent that depends on
discriminants of a variable whose nominal subtype is unconstrained, unless this
subtype is indefinite, or the variable is constrained by its initial value. A
slice of an array shall not be renamed if this restriction disallows
renaming of the array. In addition to the places where Legality Rules normally
apply, these rules apply also in the private part of an instance of a generic
unit. These rules also apply for a renaming that appears in the body of a
generic unit, with the additional requirement that even if the nominal subtype
of the variable is indefinite, its type shall not be a descendant of an
untagged generic formal derived type.
Replace paragraph 6: [AI95-00230-01; AI95-00409-01]
An object_renaming_declaration declares a new view of the renamed object
whose properties are identical to those of the renamed view. Thus, the
properties of the renamed object are not affected by the
renaming_declaration. In particular, its value and whether or not it is a
constant are unaffected; similarly, the constraints that apply to an object are
not affected by renaming (any constraint implied by the subtype_mark of
the object_renaming_declaration is ignored).
by:
An object_renaming_declaration declares a new view of the renamed object
whose properties are identical to those of the renamed view. Thus, the
properties of the renamed object are not affected by the
renaming_declaration. In particular, its value and whether or not it is a
constant are unaffected; similarly, the null exclusion or constraints that
apply to an object are not affected by renaming (any constraint implied by the
subtype_mark or access_definition of the
object_renaming_declaration is ignored).
8.5.3 Package Renaming Declarations
Insert after paragraph 3: [AI95-00217-06; AI95-00412-01]
The renamed entity shall be a package.
the new paragraph:
If the package_name of a package_renaming_declaration denotes a
limited view of a package P, then a name that denotes the
package_renaming_declaration shall occur only within the immediate scope
of the renaming or the scope of a with_clause that mentions the package
P or (if P is a nested package) the innermost library package enclosing
P.
Insert after paragraph 4: [AI95-00412-01]
A package_renaming_declaration declares a new view of the renamed package.
the new paragraph:
At places where the declaration of the limited view of the renamed package is
visible, a name that denotes the package_renaming_declaration denotes
a limited view of the package (see 10.1.1).
8.5.4 Subprogram Renaming Declarations
Replace paragraph 2: [AI95-00218-03]
subprogram_renaming_declaration ::= subprogram_specification renames callable_entity_name;
by:
subprogram_renaming_declaration ::=
[overriding_indicator]
subprogram_specification renames callable_entity_name;
Insert after paragraph 4: [AI95-00423-01]
The profile of a renaming-as-declaration shall be mode-conformant with that of
the renamed callable entity.
the new paragraphs:
For a parameter or result subtype of the subprogram_specification that
has an explicit null_exclusion:
-
if the subprogram_renaming_declaration occurs within the body of
a generic unit G or within the body of a generic unit declared within the
declarative region of the generic unit G, and the
callable_entity_name denotes a generic formal
subprogram of G, then the corresponding parameter or result
subtype of that formal subprogram shall have a null_exclusion;
-
otherwise, the subtype of the corresponding parameter or result type
of the renamed callable entity shall exclude null. In addition to
the places where Legality Rules normally apply (see 12.3), this rule
applies also in the private part of an instance of a generic unit.
Insert after paragraph 5: [AI95-00228-01]
The profile of a renaming-as-body shall be subtype-conformant with that of the
renamed callable entity, and shall conform fully to that of the declaration it
completes. If the renaming-as-body completes that declaration before the
subprogram it declares is frozen, the profile shall be mode-conformant with
that of the renamed callable entity and the subprogram it declares takes its
convention from the renamed subprogram; otherwise, the profile shall be
subtype-conformant with that of the renamed callable entity and the convention
of the renamed subprogram shall not be Intrinsic. A renaming-as-body is illegal
if the declaration occurs before the subprogram whose declaration it completes
is frozen, and the renaming renames the subprogram itself, through one or more
subprogram renaming declarations, none of whose subprograms has been frozen.
the new paragraph:
If the callable_entity_name of a renaming denotes a subprogram which
shall be overridden (see 3.9.3), then the renaming is illegal.
8.6 The Context of Overload Resolution
Replace paragraph 17: [AI95-00382-01]
If a usage name appears within the declarative region of a type_declaration
and denotes that same type_declaration, then it denotes the current
instance of the type (rather than the type itself). The current instance of a
type is the object or value of the type that is associated with the execution
that evaluates the usage name.
by:
If a usage name appears within the declarative region of a type_declaration
and denotes that same type_declaration, then it denotes the current
instance of the type (rather than the type itself); the current instance of a
type is the object or value of the type that is associated with the execution
that evaluates the usage name. This rule does not apply if the usage name
appears within the subtype_mark of an access_definition for an
access-to-object type, or within the subtype of a parameter or result of an
access-to-subprogram type.
Replace paragraph 20: [AI95-00231-01]
The expected type for a given expression, name,
or other construct determines, according to the type resolution
rules given below, the types considered for the construct during
overload resolution.
The type resolution rules provide support for class-wide programming,
universal numeric literals, dispatching
operations, and anonymous access types:
by:
The expected type for a given expression, name,
or other construct determines, according to the type resolution
rules given below, the types considered for the construct during
overload resolution.
The type resolution rules provide support for class-wide programming,
universal literals, dispatching operations, and anonymous access types:
Replace paragraph 25: [AI95-00230-01; AI95-00231-01; AI95-00254-01; AI95-00409-01]
-
when T is an anonymous access type (see 3.10) with designated
type D, to an access-to-variable type whose designated type is D'Class
or is covered by D.
by:
-
when T is a specific anonymous access-to-object type (see 3.10)
with designated type D, to an access-to-object type whose designated type
is D'Class or is covered by D; or
-
when T is an anonymous access-to-subprogram type (see 3.10), to
an access-to-subprogram type whose designated profile is type-conformant
with that of T.
Replace paragraph 27: [AI95-00332-01]
When the expected type for a construct is required to be a single type in a
given class, the type expected for the construct shall be determinable solely
from the context in which the construct appears, excluding the construct
itself, but using the requirement that it be in the given class; the type of
the construct is then this single expected type. Furthermore, the context shall
not be one that expects any type in some class that contains types of the given
class; in particular, the construct shall not be the operand of a
type_conversion.
by:
When a construct is one that requires that its expected type be a single type
in a given class, the type of the construct shall be determinable solely from
the context in which the construct appears, excluding the construct itself, but
using the requirement that it be in the given class. Furthermore, the context
shall not be one that expects any type in some class that contains types of
the given class; in particular, the construct shall not be the operand of a
type_conversion.
Section 9: Tasks and Synchronization
9.1 Task Units and Task Objects
Replace paragraph 2: [AI95-00345-01]
task_type_declaration ::=
task type defining_identifier [known_discriminant_part] [is task_definition];
by:
task_type_declaration ::=
task type defining_identifier [known_discriminant_part] [is
[new interface_list with]
task_definition];
Replace paragraph 3: [AI95-00399-01]
single_task_declaration ::=
task defining_identifier [is task_definition];
by:
single_task_declaration ::=
task defining_identifier [is
[new interface_list with]
task_definition];
Delete paragraph 8: [AI95-00345-01]
A task declaration requires a completion, which shall be a task_body, and
every task_body shall be the completion of some task declaration.
Insert after paragraph 9.1: [AI95-00345-01; AI95-00397-01; AI95-00401-01; AI95-00419-01]
For a task declaration without a task_definition, a task_definition
without task_items is assumed.
the new paragraphs:
For a task declaration with an interface_list, the task type
inherits user-defined primitive subprograms from each progenitor
type (see 3.9.4), in the same way that a derived type inherits
user-defined primitive subprograms from its progenitor types (see
3.4). If the first parameter of a primitive
inherited subprogram is of the task type or an access parameter designating the
task type, and there is an entry_declaration for a single entry with the
same identifier within the task declaration, whose profile is type
conformant with the prefixed view profile of the inherited subprogram, the
inherited subprogram is said to be implemented by the conforming task
entry.
A task declaration requires a completion, which shall be a task_body, and
every task_body shall be the completion of some task declaration.
Each interface_subtype_mark of an interface_list appearing within a
task declaration shall denote a limited interface type that
is not a protected interface.
The prefixed view profile of an explicitly declared
primitive subprogram of a tagged task type shall not be type
conformant with any entry of the task type, if the first
parameter of the subprogram is of the task type or is an
access parameter designating the task type.
For each primitive subprogram inherited by the type declared by a
task declaration, at most one of the following shall apply:
-
the inherited subprogram is overridden with a primitive
subprogram of the task type, in which case the overriding
subprogram shall be subtype conformant with the inherited
subprogram and not abstract; or
-
the inherited subprogram is implemented by a single entry of the task type;
in which case its prefixed view profile shall be subtype conformant with that
of the task entry.
If neither applies, the inherited subprogram shall be a null procedure. In
addition to the places where Legality Rules normally apply (see 12.3), these
rules also apply in the private part of an instance of a generic unit.
Replace paragraph 19: [AI95-00382-01]
2 Within the declaration or body of a task unit, the name of the
task unit denotes the current instance of
the unit (see 8.6), rather than the first subtype of the corresponding task
type (and thus the name cannot be used as a subtype_mark).
by:
2 Within the declaration or body of a task unit other than in an
access_definition, the name of the task unit denotes the current instance
of the unit (see 8.6), rather than the first subtype of the corresponding task
type (and thus the name cannot be used as a subtype_mark).
Replace paragraph 21: [AI95-00287-01]
4 A task type is a limited type (see 7.5), and hence has neither
an assignment operation nor predefined equality operators. If an application
needs to store and exchange task identities, it can do so by defining an access
type designating the corresponding task objects and by using access values for
identification purposes. Assignment is available for such an access type as for
any access type. Alternatively, if the implementation supports the Systems
Programming Annex, the Identity attribute can be used for task identification
(see C.7).
by:
4 A task type is a limited type (see 7.5), and hence precludes
use of assignment_statements and predefined equality operators. If an
application needs to store and exchange task identities, it can do so by
defining an access type designating the corresponding task objects and by using
access values for identification purposes. Assignment is available for such an
access type as for any access type. Alternatively, if the implementation
supports the Systems Programming Annex, the Identity attribute can be used for
task identification (see C.7.1).
Replace paragraph 24: [AI95-00433-01]
task type Keyboard_Driver(ID : Keyboard_ID := New_ID) is
entry Read (C : out Character);
entry Write(C : in Character);
end Keyboard_Driver;
by:
task type Keyboard_Driver(ID : Keyboard_ID := New_ID) is
new Serial_Device with -- see 3.9.4
entry Read (C : out Character);
entry Write(C : in Character);
end Keyboard_Driver;
9.2 Task Execution - Task Activation
Replace paragraph 2: [AI95-00416-01]
A task object (which represents one task) can be created either as part of the
elaboration of an object_declaration occurring immediately within some
declarative region, or as part of the evaluation of an allocator. All
tasks created by the elaboration of object_declarations of a single
declarative region (including subcomponents of the declared objects) are
activated together. Similarly, all tasks created by the evaluation of a single
allocator are activated together. The activation of a task is associated
with the innermost allocator or object_declaration that is
responsible for its creation.
by:
A task object (which represents one task) can be a part of a
stand-alone object, of an object created by an allocator, or of an
anonymous object of a limited type, or a coextension of one of these.
All tasks that are part or coextensions of any
of the stand-alone objects created by the elaboration of
object_declarations (or generic_associations of formal objects of
mode in) of a single declarative region are activated together. All tasks
that are part or coextensions of a single object that is not a stand-alone
object are activated together.
Replace paragraph 3: [AI95-00416-01]
For tasks created by the elaboration of object_declarations of a given
declarative region, the activations are initiated within the context of the
handled_sequence_of_statements (and its associated exception_handlers
if any — see 11.2), just prior to executing the statements of the
_sequence. For a package without an explicit body or an explicit
handled_sequence_of_statements, an implicit body or an implicit
null_statement is assumed, as defined in 7.2.
by:
For the tasks of a given declarative region, the activations are initiated
within the context of the handled_sequence_of_statements (and its
associated exception_handlers if any — see 11.2), just prior to executing
the statements of the handled_sequence_of_statements. For a package
without an explicit body or an explicit handled_sequence_of_statements, an
implicit body or an implicit null_statement is assumed, as defined in 7.2.
Replace paragraph 4: [AI95-00416-01]
For tasks created by the evaluation of an allocator, the activations are
initiated as the last step of evaluating the allocator, after completing
any initialization for the object created by the allocator, and prior to
returning the new access value.
by:
For tasks that are part or coextensions of a single object that is not a
stand-alone object, activations are initiated after completing any
initialization of the outermost object enclosing these tasks, prior
to performing any other operation on the outermost object. In
particular, for tasks that are part or coextensions of the object created
by the evaluation of an allocator, the activations are initiated as
the last step of evaluating the allocator, prior
to returning the new access value. For tasks that are part or coextensions
of an object that is the result of a function call, the activations are
not initiated until after the function returns.
9.3 Task Dependence - Termination of Tasks
Replace paragraph 2: [AI95-00162-01]
-
If the task is created by the evaluation of an allocator for a
given access type, it depends on each master that includes the elaboration of
the declaration of the ultimate ancestor of the given access type.
by:
-
If the task is created by the evaluation of an allocator for a
given access type, it depends on each master that includes the elaboration of
the declaration of the ultimate ancestor of the given access type other than
the declaration itself.
Replace paragraph 3: [AI95-00162-01]
-
If the task is created by the elaboration of an
object_declaration, it depends on each master that includes this
elaboration.
by:
-
If the task is created by the elaboration of an
object_declaration, it depends on each master that includes this
elaboration other than the declaration itself.
Replace paragraph 7: [AI95-00415-01]
-
The task depends on some completed master;
by:
-
The task depends on some completed master; and
9.4 Protected Units and Protected Objects
Replace paragraph 2: [AI95-00345-01]
protected_type_declaration ::=
protected type defining_identifier [known_discriminant_part] [is protected_definition];
by:
protected_type_declaration ::=
protected type defining_identifier [known_discriminant_part] [is
[new interface_list with]
protected_definition];
Replace paragraph 3: [AI95-00399-01]
single_protected_declaration ::=
protected defining_identifier is protected_definition;
by:
single_protected_declaration ::=
protected defining_identifier is
[new interface_list with]
protected_definition;
Delete paragraph 10: [AI95-00345-01]
A protected declaration requires a completion, which shall be a
protected_body, and every protected_body shall be the completion of
some protected declaration.
Insert after paragraph 11: [AI95-00345-01; AI95-00397-01; AI95-00401-01; AI95-00419-01]
A protected_definition defines a protected type and its first subtype. The
list of protected_operation_declarations of a protected_definition,
together with the known_discriminant_part, if any, is called the visible
part of the protected unit. The optional list of
protected_element_declarations after the reserved word private is
called the private part of the protected unit.
the new paragraphs:
For a protected declaration with an interface_list, the
protected type inherits user-defined primitive subprograms from each
progenitor type (see 3.9.4), in the same way that a derived type
inherits user-defined primitive subprograms from its progenitor
types (see 3.4). If the first parameter of a primitive
inherited subprogram is of the protected type or an access parameter
designating the protected type, and there is a
protected_operation_declaration for a protected subprogram or single entry
with the same identifier within the protected declaration, whose
profile is type conformant with the prefixed view profile of the inherited
subprogram, the inherited subprogram is said to be implemented by the
conforming protected subprogram or entry.
A protected declaration requires a completion, which shall be a
protected_body, and every protected_body shall be the completion of
some protected declaration.
Each interface_subtype_mark of an interface_list appearing within a
protected declaration shall denote a limited interface type that
is not a task interface.
The prefixed view profile of an explicitly declared primitive subprogram of a
tagged protected type shall not be type conformant with any protected operation
of the protected type, if the first parameter of the subprogram is of the
protected type or is an access parameter designating the protected type.
For each primitive subprogram inherited by the type declared by a
protected declaration, at most one of the following shall apply:
-
the inherited subprogram is overridden with a primitive
subprogram of the protected type, in which case the overriding
subprogram shall be subtype conformant with the inherited
subprogram and not abstract; or
-
the inherited subprogram is implemented by a protected subprogram or
single entry of the protected type, in which case its prefixed view profile
shall be subtype conformant with that of the protected subprogram or entry.
If neither applies, the inherited subprogram shall be a null procedure. In
addition to the places where Legality Rules normally apply (see 12.3), these
rules also apply in the private part of an instance of a generic unit.
If an inherited subprogram is implemented by a protected procedure or
an entry, then the first parameter of the inherited subprogram shall be
of mode out or in out, or an access-to-variable parameter.
If a protected subprogram declaration has an overriding_indicator, then:
-
if the overriding_indicator is overriding, then the
subprogram shall implement an inherited subprogram, at the point of the
declaration;
-
if the overriding_indicator is not overriding, then the
subprogram shall not implement any inherited subprogram (at any point).
Insert after paragraph 20: [AI95-00280-01]
As the first step of the finalization of a protected object, each call
remaining on any entry queue of the object is removed from its queue and
Program_Error is raised at the place of the corresponding
entry_call_statement.
the new paragraph:
Bounded (Run-Time) Errors
It is a bounded error to call an entry or subprogram of a protected object
after that object is finalized. If the error is detected, Program_Error
is raised. Otherwise, the call proceeds normally, which may leave a task queued
forever.
Replace paragraph 21: [AI95-00382-01]
13 Within the declaration or body of a protected unit, the name
of the protected unit denotes the current instance of the unit (see 8.6),
rather than the first subtype of the corresponding protected type (and thus the
name cannot be used as a subtype_mark).
by:
13 Within the declaration or body of a protected unit other than
in an access_definition, the name of the protected unit denotes the
current instance of the unit (see 8.6), rather than the first subtype of the
corresponding protected type (and thus the name cannot be used as a
subtype_mark).
Replace paragraph 23: [AI95-00287-01]
15 A protected type is a limited type (see 7.5), and hence has
neither an assignment operation nor predefined equality operators.
by:
15 A protected type is a limited type (see 7.5), and hence
precludes use of assignment_statements and predefined equality operators.
9.5.1 Protected Subprograms and Protected Actions
Insert after paragraph 22: [AI95-00305-01]
21 From within a protected action, an internal call on a
protected subprogram, or an external call on a protected subprogram with a
different target object is not considered a potentially blocking operation.
the new paragraph:
22 The @nt{pragma} Detect_Blocking may be used to ensure that all
executions of potentially blocking operations raise Program_Error. See H.5.
9.5.2 Entries and Accept Statements
Replace paragraph 2: [AI95-00397-01]
entry_declaration ::=
entry defining_identifier [(discrete_subtype_definition)] parameter_profile;
by:
entry_declaration ::=
[overriding_indicator]
entry defining_identifier [(discrete_subtype_definition)] parameter_profile;
Insert after paragraph 10: [AI95-00397-01]
An entry_declaration is allowed only in a protected or task declaration.
the new paragraph:
An overriding_indicator is not allowed in an entry_declaration that
includes a discrete_subtype_definition.
Insert after paragraph 13: [AI95-00397-01]
An entry_declaration in a task declaration shall not contain a specification for an access parameter (see 3.10).
the new paragraphs:
If an entry_declaration has an overriding_indicator, then:
-
if the overriding_indicator is overriding, then the entry shall implement
an inherited subprogram, at the point of the declaration;
-
if the overriding_indicator is not overriding, then the operation shall not
implement any inherited subprogram (at any point).
In addition to the places where Legality Rules normally apply (see 12.3), these
rules also apply in the private part of an instance of a generic unit.
Replace paragraph 29: [AI95-00318-02]
24 A return_statement (see 6.5) or a requeue_statement
(see 9.5.4) may be used to complete the execution of an accept_statement
or an entry_body.
by:
24 A return statement (see 6.5) or a requeue_statement
(see 9.5.4) may be used to complete the execution of an accept_statement
or an entry_body.
9.6 Delay Statements, Duration, and Time
Replace paragraph 11: [AI95-00351-01]
subtype Year_Number is Integer range 1901 .. 2099;
subtype Month_Number is Integer range 1 .. 12;
subtype Day_Number is Integer range 1 .. 31;
subtype Day_Duration is Duration range 0.0 .. 86_400.0;
by:
subtype Year_Number is Integer range 1901 .. 2399;
subtype Month_Number is Integer range 1 .. 12;
subtype Day_Number is Integer range 1 .. 31;
subtype Day_Duration is Duration range 0.0 .. 86_400.0;
Replace paragraph 24: [AI95-00351-01]
The functions Year, Month, Day, and Seconds return the corresponding values for
a given value of the type Time, as appropriate to an implementation-defined
timezone; the procedure Split returns all four corresponding values.
Conversely, the function Time_Of combines a year number, a month number, a day
number, and a duration, into a value of type Time. The operators "+" and "-"
for addition and subtraction of times and durations, and the relational
operators for times, have the conventional meaning.
by:
The functions Year, Month, Day, and Seconds return the corresponding values for
a given value of the type Time, as appropriate to an implementation-defined
time zone; the procedure Split returns all four corresponding values.
Conversely, the function Time_Of combines a year number, a month number, a day
number, and a duration, into a value of type Time. The operators "+" and "–"
for addition and subtraction of times and durations, and the relational
operators for times, have the conventional meaning.
9.6.1 Formatting, Time Zones, and other operations for Time
Insert new clause: [AI95-00351-01; AI95-00427-01]
The following language-defined library packages exist:
package Ada.Calendar.Time_Zones is
-- Time zone manipulation:
type Time_Offset is range -28*60 .. 28*60;
Unknown_Zone_Error : exception;
function UTC_Time_Offset (Date : Time := Clock) return Time_Offset;
end Ada.Calendar.Time_Zones;
package Ada.Calendar.Arithmetic is
-- Arithmetic on days:
type Day_Count is range
-366*(1+Year_Number'Last - Year_Number'First)
..
366*(1+Year_Number'Last - Year_Number'First);
subtype Leap_Seconds_Count is Integer range -2047 .. 2047;
procedure Difference (Left, Right : in Time;
Days : out Day_Count;
Seconds : out Duration;
Leap_Seconds : out Leap_Seconds_Count);
function "+" (Left : Time; Right : Day_Count) return Time;
function "+" (Left : Day_Count; Right : Time) return Time;
function "-" (Left : Time; Right : Day_Count) return Time;
function "-" (Left, Right : Time) return Day_Count;
end Ada.Calendar.Arithmetic;
with Ada.Calendar.Time_Zones;
package Ada.Calendar.Formatting is
-- Day of the week:
type Day_Name is (Monday, Tuesday, Wednesday, Thursday,
Friday, Saturday, Sunday);
function Day_of_Week (Date : Time) return Day_Name;
-- Hours:Minutes:Seconds access:
subtype Hour_Number is Natural range 0 .. 23;
subtype Minute_Number is Natural range 0 .. 59;
subtype Second_Number is Natural range 0 .. 59;
subtype Second_Duration is Day_Duration range 0.0 .. 1.0;
function Year (Date : Time;
Time_Zone : Time_Zones.Time_Offset := 0)
return Year_Number;
function Month (Date : Time;
Time_Zone : Time_Zones.Time_Offset := 0)
return Month_Number;
function Day (Date : Time;
Time_Zone : Time_Zones.Time_Offset := 0)
return Day_Number;
function Hour (Date : Time;
Time_Zone : Time_Zones.Time_Offset := 0)
return Hour_Number;
function Minute (Date : Time;
Time_Zone : Time_Zones.Time_Offset := 0)
return Minute_Number;
function Second (Date : Time)
return Second_Number;
function Sub_Second (Date : Time)
return Second_Duration;
function Seconds_Of (Hour : Hour_Number;
Minute : Minute_Number;
Second : Second_Number := 0;
Sub_Second : Second_Duration := 0.0)
return Day_Duration;
procedure Split (Seconds : in Day_Duration;
Hour : out Hour_Number;
Minute : out Minute_Number;
Second : out Second_Number;
Sub_Second : out Second_Duration);
procedure Split (Date : in Time;
Year : out Year_Number;
Month : out Month_Number;
Day : out Day_Number;
Hour : out Hour_Number;
Minute : out Minute_Number;
Second : out Second_Number;
Sub_Second : out Second_Duration;
Time_Zone : in Time_Zones.Time_Offset := 0);
function Time_Of (Year : Year_Number;
Month : Month_Number;
Day : Day_Number;
Hour : Hour_Number;
Minute : Minute_Number;
Second : Second_Number;
Sub_Second : Second_Duration := 0.0;
Leap_Second: Boolean := False;
Time_Zone : Time_Zones.Time_Offset := 0)
return Time;
function Time_Of (Year : Year_Number;
Month : Month_Number;
Day : Day_Number;
Seconds : Day_Duration := 0.0;
Leap_Second: Boolean := False;
Time_Zone : Time_Zones.Time_Offset := 0)
return Time;
procedure Split (Date : in Time;
Year : out Year_Number;
Month : out Month_Number;
Day : out Day_Number;
Hour : out Hour_Number;
Minute : out Minute_Number;
Second : out Second_Number;
Sub_Second : out Second_Duration;
Leap_Second: out Boolean;
Time_Zone : in Time_Zones.Time_Offset := 0);
procedure Split (Date : in Time;
Year : out Year_Number;
Month : out Month_Number;
Day : out Day_Number;
Seconds : out Day_Duration;
Leap_Second: out Boolean;
Time_Zone : in Time_Zones.Time_Offset := 0);
-- Simple image and value:
function Image (Date : Time;
Include_Time_Fraction : Boolean := False;
Time_Zone : Time_Zones.Time_Offset := 0) return String;
function Value (Date : String;
Time_Zone : Time_Zones.Time_Offset := 0) return Time;
function Image (Elapsed_Time : Duration;
Include_Time_Fraction : Boolean := False) return String;
function Value (Elapsed_Time : String) return Duration;
end Ada.Calendar.Formatting;
Type Time_Offset represents the number of minutes difference between the
implementation-defined time zone used by Ada.Calendar and another time zone.
function UTC_Time_Offset (Date : Time := Clock) return Time_Offset;
Returns, as a number of minutes, the difference between the
implementation-defined time zone of Calendar, and UTC time,
at the time Date. If the time zone of the Calendar implementation is
unknown, then Unknown_Zone_Error is raised.
procedure Difference (Left, Right : in Time;
Days : out Day_Count;
Seconds : out Duration;
Leap_Seconds : out Leap_Seconds_Count);
Returns the difference between Left and Right.
Days is the number of days of difference, Seconds is the
remainder seconds of difference excluding leap seconds, and
Leap_Seconds is the number of leap seconds.
If Left < Right, then Seconds <= 0.0, Days <= 0, and Leap_Seconds <= 0.
Otherwise, all values are non-negative. The absolute value of
Seconds is always less than 86_400.0.
For the returned values, if Days = 0, then
Seconds + Duration(Leap_Seconds) = Calendar."–" (Left, Right).
function "+" (Left : Time; Right : Day_Count) return Time;
function "+" (Left : Day_Count; Right : Time) return Time;
Adds a number of days to a time value. Time_Error is raised
if the result is not representable as a value of type Time.
function "-" (Left : Time; Right : Day_Count) return Time;
Subtracts a number of days from a time value. Time_Error is raised
if the result is not representable as a value of type Time.
function "-" (Left, Right : Time) return Day_Count;
Subtracts two time values, and returns the number of days between
them. This is the same value that Difference would return in Days.
function Day_of_Week (Date : Time) return Day_Name;
Returns the day of the week for Time. This is based on the Year,
Month, and Day values of Time.
function Year (Date : Time;
Time_Zone : Time_Zones.Time_Offset := 0)
return Year_Number;
Returns the year for Date, as appropriate for the specified time zone
offset.
function Month (Date : Time;
Time_Zone : Time_Zones.Time_Offset := 0)
return Month_Number;
Returns the month for Date, as appropriate for the specified time zone
offset.
function Day (Date : Time;
Time_Zone : Time_Zones.Time_Offset := 0)
return Day_Number;
Returns the day number for Date, as appropriate for the specified time
zone offset.
function Hour (Date : Time;
Time_Zone : Time_Zones.Time_Offset := 0)
return Hour_Number;
Returns the hour for Date, as appropriate for the specified time zone
offset.
function Minute (Date : Time;
Time_Zone : Time_Zones.Time_Offset := 0)
return Minute_Number;
Returns the minute within the hour for Date, as appropriate for the
specified time zone offset.
function Second (Date : Time)
return Second_Number;
Returns the second within the hour and minute for Date.
function Sub_Second (Date : Time)
return Second_Duration;
Returns the fraction of second for Date (this has the same accuracy
as Day_Duration). The value returned is always less than 1.0.
function Seconds_Of (Hour : Hour_Number;
Minute : Minute_Number;
Second : Second_Number := 0;
Sub_Second : Second_Duration := 0.0)
return Day_Duration;
Returns a Day_Duration value for the combination of the given
Hour, Minute, Second, and Sub_Second.
This value can be used in Calendar.Time_Of as well as the argument to
Calendar."+" and Calendar."–". If Seconds_Of is called with a Sub_Second value
of 1.0, the value returned is equal to the value of Seconds_Of for the next
second with a Sub_Second value of 0.0.
procedure Split (Seconds : in Day_Duration;
Hour : out Hour_Number;
Minute : out Minute_Number;
Second : out Second_Number;
Sub_Second : out Second_Duration);
Splits Seconds into Hour, Minute, Second and Sub_Second in such a way
that the resulting values all belong to their respective subtypes. The
value returned through the Sub_Second parameter is always less than 1.0.
procedure Split (Date : in Time;
Year : out Year_Number;
Month : out Month_Number;
Day : out Day_Number;
Hour : out Hour_Number;
Minute : out Minute_Number;
Second : out Second_Number;
Sub_Second : out Second_Duration;
Time_Zone : in Time_Zones.Time_Offset := 0);
Splits Date into its constituent parts (Year, Month, Day, Hour, Minute,
Second, Sub_Second), relative to the specified time zone offset. The value
returned through the Sub_Second parameter is always less than 1.0.
function Time_Of (Year : Year_Number;
Month : Month_Number;
Day : Day_Number;
Hour : Hour_Number;
Minute : Minute_Number;
Second : Second_Number;
Sub_Second : Second_Duration := 0.0;
Leap_Second: Boolean := False;
Time_Zone : Time_Zones.Time_Offset := 0)
return Time;
Returns a Time built from the date and time values, relative to the
specified time zone offset. Time_Error is raised if Leap_Second is True,
and Hour, Minute, and Second are not appropriate for a Leap_Second.
If Time_Of is called with a Sub_Second value of 1.0, the value
returned is equal to the value of Time_Of for the next second with
a Sub_Second value of 0.0.
function Time_Of (Year : Year_Number;
Month : Month_Number;
Day : Day_Number;
Seconds : Day_Duration := 0.0;
Leap_Second: Boolean := False;
Time_Zone : Time_Zones.Time_Offset := 0)
return Time;
Returns a Time built from the date and time values, relative to the
specified time zone offset. Time_Error is raised if Leap_Second is True,
and Seconds is not appropriate for a Leap_Second. If Time_Of is called with a
Seconds value of 86_400.0, the value returned is equal to the value of Time_Of
for the next day with a Seconds value of 0.0.
procedure Split (Date : in Time;
Year : out Year_Number;
Month : out Month_Number;
Day : out Day_Number;
Hour : out Hour_Number;
Minute : out Minute_Number;
Second : out Second_Number;
Sub_Second : out Second_Duration;
Leap_Second: out Boolean;
Time_Zone : in Time_Zones.Time_Offset := 0);
Split Date into its constituent parts (Year, Month, Day, Hour, Minute,
Second, Sub_Second), relative to the specified time zone offset.
Leap_Second is True if Date identifies a leap second.
procedure Split (Date : in Time;
Year : out Year_Number;
Month : out Month_Number;
Day : out Day_Number;
Seconds : out Day_Duration;
Leap_Second: out Boolean;
Time_Zone : in Time_Zones.Time_Offset := 0);
Split Date into its constituent parts (Year, Month, Day, Seconds),
relative to the specified time zone offset. Leap_Second is True if Date
identifies a leap second.
function Image (Date : Time;
Include_Time_Fraction : Boolean := False;
Time_Zone : Time_Zones.Time_Offset := 0) return String;
Returns a string form of the Date relative to the given Time_Zone.
The format is "Year-Month-Day Hour:Minute:Second", where each value
other than Year is a 2-digit form of the value of the functions
defined in Calendar and Calendar.Formatting, including a leading zero,
if needed. Year is a 4-digit value.
If Include_Time_Fraction is True, the integer part of Sub_Seconds*100 is
suffixed to the string as a 2-digit value following a point.
function Value (Date : String;
Time_Zone : Time_Zones.Time_Offset := 0) return Time;
Returns a Time value for the image given as Date, relative to the
given time zone. Constraint_Error is raised if the string is not formatted as
described for Image, or the function cannot interpret the given string as a
Time value.
function Image (Elapsed_Time : Duration;
Include_Time_Fraction : Boolean := False) return String;
Returns a string form of the Elapsed_Time.
The format is "Hour:Minute:Second", where each value
is a 2-digit form of the value, including a leading zero, if needed.
If Include_Time_Fraction is True, the integer part of Sub_Seconds*100 is
suffixed to the string as a 2-digit value following a point.
If Elapsed_Time < 0.0, the result is Image (abs Elapsed_Time,
Include_Time_Fraction) prefixed with a minus sign. If abs Elapsed_Time
represents 100 hours or more, the result is implementation-defined.
function Value (Elapsed_Time : String) return Duration;
Returns a Duration value for the image given as Elapsed_Time.
Constraint_Error is raised if the string is not formatted as described for
Image, or the function cannot interpret the given string as a Duration
value.
An implementation should support leap seconds if the target system supports
them. If leap seconds are not supported, Difference should return zero for
Leap_Seconds, Split should return False for Leap_Second, and Time_Of should
raise Time_Error if Leap_Second is True.
NOTES
36 The implementation-defined time zone of package Calendar
may, but need not, be the local time zone. UTC_Time_Offset always returns the
difference relative to the implementation-defined time zone of package
Calendar. If UTC_Time_Offset does not raise Unknown_Zone_Error, UTC time
can be safely calculated (within the accuracy of the underlying time-base).
37 Calling Split on the results of subtracting Duration(UTC_Time_Offset*60)
from Clock provides the components (hours, minutes, and so on) of the UTC
time. In the United States, for example, UTC_Time_Offset will generally be
negative.
9.7.2 Timed Entry Calls
Replace paragraph 1: [AI95-00345-01]
A timed_entry_call issues an entry call that is cancelled if the call (or
a requeue-with-abort of the call) is not selected before the expiration time
is reached.
by:
A timed_entry_call issues an entry call that is cancelled if the call (or
a requeue-with-abort of the call) is not selected before the expiration time
is reached. A procedure call may appear rather than an entry call for cases
where the procedure might be implemented by an entry.
Replace paragraph 3: [AI95-00345-01]
entry_call_alternative ::=
entry_call_statement [sequence_of_statements]
by:
entry_call_alternative ::=
procedure_or_entry_call [sequence_of_statements]
procedure_or_entry_call ::=
procedure_call_statement | entry_call_statement
If a procedure_call_statement is used for a procedure_or_entry_call,
the procedure_name or procedure_prefix of the
procedure_call_statement shall denote an entry renamed as a procedure, a
formal subprogram, or (a view of) a primitive subprogram of a limited interface
whose first parameter is a controlling parameter (see 3.9.2).
If a procedure_call_statement is used for a procedure_or_entry_call,
and the procedure is implemented by an entry, then the procedure_name,
or procedure_prefix and possibly the first parameter of
the procedure_call_statement, determine the target object of the call
and the entry to be called.
Replace paragraph 4: [AI95-00345-01]
For the execution of a timed_entry_call, the entry_name and the
actual parameters are evaluated, as for a simple entry call (see 9.5.3). The
expiration time (see 9.6) for the call is determined by evaluating the
delay_expression of the delay_alternative; the entry call is then
issued.
by:
For the execution of a timed_entry_call, the entry_name,
procedure_name, or procedure_prefix, and any actual
parameters are evaluated, as for a simple entry call (see 9.5.3) or procedure
call (see 6.4). The expiration time (see 9.6) for the call is determined by
evaluating the delay_expression of the delay_alternative. If the
call is an entry call or a call on a procedure implemented by an entry, the
entry call is then issued. Otherwise, the call proceeds as described in 6.4 for
a procedure call, followed by the sequence_of_statements of the
entry_call_alternative, and the sequence_of_statements of the
delay_alternative is ignored.
9.7.3 Conditional Entry Calls
Replace paragraph 1: [AI95-00345-01]
A conditional_entry_call issues an entry call that is then cancelled if it
is not selected immediately (or if a requeue-with-abort of the call is not
selected immediately).
by:
A conditional_entry_call issues an entry call that is then cancelled if it
is not selected immediately (or if a requeue-with-abort of the call is not
selected immediately). A procedure call may appear rather than an entry call
for cases where the procedure might be implemented by an entry.
9.7.4 Asynchronous Transfer of Control
Replace paragraph 4: [AI95-00345-01]
triggering_statement ::= entry_call_statement | delay_statement
by:
triggering_statement ::= procedure_or_entry_call | delay_statement
Replace paragraph 6: [AI95-00345-01]
For the execution of an asynchronous_select whose triggering_statement
is an entry_call_statement, the entry_name and actual parameters
are evaluated as for a simple entry call (see 9.5.3), and the entry call is
issued. If the entry call is queued (or requeued-with-abort), then the
abortable_part is executed. If the entry call is selected immediately,
and never requeued-with-abort, then the abortable_part is never started.
by:
For the execution of an asynchronous_select whose
triggering_statement is a procedure_or_entry_call, the
entry_name, procedure_name, or procedure_prefix,
and actual parameters are evaluated as for a simple entry
call (see 9.5.3) or procedure call (see 6.4). If the call is an entry call or a
call on a procedure implemented by an entry, the entry call is issued. If the
entry call is queued (or requeued-with-abort), then the abortable_part is
executed. If the entry call is selected immediately, and never
requeued-with-abort, then the abortable_part is never started. If the call
is on a procedure that is not implemented by an entry, the call proceeds as
described in 6.4, followed by the sequence_of_statements of the
triggering_alternative, and the abortable_part is never started.
9.8 Abort of a Task - Abort of a Sequence of Statements
Replace paragraph 3: [AI95-00345-01]
Each task_name is expected to be of any task type; they need not all
be of the same task type.
by:
Each task_name is expected to be of any task type or task interface
type; they need not all be of the same type.
9.9 Task and Entry Attributes
Replace paragraph 1: [AI95-00345-01]
For a prefix T that is of a task type (after any implicit dereference),
the following attributes are defined:
by:
For a prefix T that is of a task type or task interface type (after any
implicit dereference), the following attributes are defined:
9.11 Example of Tasking and Synchronization
Replace paragraph 3: [AI95-00433-01]
task body Producer is
Char : Character;
begin
loop
... -- produce the next character Char
Buffer.Write(Char);
exit when Char = ASCII.EOT;
end loop;
end Producer;
by:
task body Producer is
Element : Person_Name; -- see 3.10.1
begin
loop
... -- produce the next person (for instance, simulating arrivals)
Buffer.Append_Wait(Element);
exit when Element = null;
end loop;
end Producer;
Replace paragraph 6: [AI95-00433-01]
task body Consumer is
Char : Character;
begin
loop
Buffer.Read(Char);
exit when Char = ASCII.EOT;
... -- consume the character Char
end loop;
end Consumer;
by:
task body Consumer is
Element : Person_Name;
begin
loop
Buffer.Remove_First_Wait(Element);
exit when Element = null;
... -- consume the person (for instance, simulating serving a customer)
end loop;
end Consumer;
Replace paragraph 7: [AI95-00433-01]
The buffer object contains an internal pool of characters managed in a
round-robin fashion. The pool has two indices, an In_Index denoting the space
for the next input character and an Out_Index denoting the space for the next
output character.
by:
The buffer object contains an internal pool of people managed in a round-robin
fashion. The pool has two indices, an In_Index denoting the space for the next
input element (person) and an Out_Index denoting the space for the next output
element.
The Buffer is defined as an extension of the Synchronized_Queue
interface (see 3.9.4), and as such, is promising to implement the abstraction
defined by that interface. By doing so, the Buffer can be passed to the
Transfer class-wide operation defined for objects of a type covered by
Queue'Class.
Replace paragraph 8: [AI95-00433-01]
protected Buffer is
entry Read (C : out Character);
entry Write(C : in Character);
private
Pool : String(1 .. 100);
Count : Natural := 0;
In_Index, Out_Index : Positive := 1;
end Buffer;
by:
protected Buffer is new Synchronized_Queue with -- see 3.9.4
entry Append_Wait(Element : in Person_Name);
entry Remove_First_Wait(Element : out Person_Name);
function Cur_Count return Natural;
function Max_Count return Natural;
procedure Append(Element : in Person_Name);
procedure Remove_First(Element : out Person_Name);
private
Pool : Person_Name_Array(1 .. 100);
Count : Natural := 0;
In_Index, Out_Index : Positive := 1;
end Buffer;
Replace paragraph 9: [AI95-00433-01]
protected body Buffer is
entry Write(C : in Character)
when Count < Pool'Length is
begin
Pool(In_Index) := C;
In_Index := (In_Index mod Pool'Length) + 1;
Count := Count + 1;
end Write;
by:
protected body Buffer is
entry Append_Wait(Element : in Person_Name)
when Count < Pool'Length is
begin
Append(Element);
end Append_Wait;
procedure Append(Element : in Person_Name) is
begin
if Count = Pool'Length then
raise Queue_Error with "Buffer Full"; -- see 11.3
end if;
Pool(In_Index) := Element;
In_Index := (In_Index mod Pool'Length) + 1;
Count := Count + 1;
end Append;
Replace paragraph 10: [AI95-00433-01]
entry Read(C : out Character)
when Count > 0 is
begin
C := Pool(Out_Index);
Out_Index := (Out_Index mod Pool'Length) + 1;
Count := Count - 1;
end Read;
end Buffer;
by:
entry Remove_First_Wait(Element : out Person_Name)
when Count > 0 is
begin
Remove_First(Element);
end Remove_First_Wait;
procedure Remove_First(Element : out Person_Name) is
begin
if Count = 0 then
raise Queue_Error with "Buffer Empty"; -- see 11.3
end if;
Element := Pool(Out_Index);
Out_Index := (Out_Index mod Pool'Length) + 1;
Count := Count - 1;
end Remove_First;
function Cur_Count return Natural is
begin
return Buffer.Count;
end Cur_Count;
function Max_Count return Natural is
begin
return Pool'Length;
end Max_Count;
end Buffer;
Section 10: Program Structure and Compilation Issues
10.1.1 Compilation Units - Library Units
Insert after paragraph 8: [AI95-00397-01]
parent_unit_name ::= name
the new paragraph:
An overriding_indicator is not allowed in a subprogram_declaration,
generic_instantiation, or subprogram_renaming_declaration which
declares a library unit.
Insert after paragraph 12: [AI95-00217-06; AI95-00326-01]
A library_unit_declaration or a library_unit_renaming_declaration is
private if the declaration is immediately preceded by the reserved word
private