Prev | Up | Next | Back | Forward
TOC -- / --.-- / --.--.-- | Index | Search | Syntax | Help


3.6.2 Operations of Array Types

Legality Rules
(1)
The argument N used in the attribute_designators for the N-th dimension of an array shall be a static expression of some integer type. The value of N shall be positive (nonzero) and no greater than the dimensionality of the array.
Static Semantics
(2)
The following attributes are defined for a prefix A that is of an array type (after any implicit dereference), or denotes a constrained array subtype:
(3)
A'First
(4)
A'First(N)
(5)
A'Last
(6)
A'Last(N)
(7)
A'Range
(8)
A'Range(N)
(9)
A'Length
(10)
A'Length(N)
Implementation Advice
(11)
An implementation should normally represent multidimensional arrays in row-major order, consistent with the notation used for multidimensional array aggregates (see 4.3.3). However, if a pragma Convention(Fortran, ...) applies to a multidimensional array type, then column-major order should be used instead (see B.5, ``Interfacing with Fortran'').

(12)
(13)
          A'Length(N) = A'Last(N) - A'First(N) + 1
(14)
(15)
(16)
Examples
(17)
Examples (using arrays declared in the examples of subclause 3.6.1):
(18)
       --  Filter'First       =    0   Filter'Last        =  31   Filter'Length  =32
       --  Rectangle'Last(1)  =   20   Rectangle'Last(2)  =  30

Prev | Up | Next | Back | Forward
TOC -- / --.-- / --.--.-- | Index | Search | Syntax | Help

Ada WWW Home -- Email comments, additions, corrections, gripes, kudos, etc. to:

Magnus Kempe -- Magnus.Kempe@di.epfl.ch
Copyright statement
Page last generated: 95-03-12