File: AA-4-3-1.html

package info (click to toggle)
ada-reference-manual 20021112web-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny, sarge
  • size: 18,652 kB
  • ctags: 8,921
  • sloc: makefile: 52; sh: 20
file content (325 lines) | stat: -rw-r--r-- 25,039 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
    <TITLE>AARM95 - Record Aggregates</TITLE>
    <META NAME="Author" CONTENT="JTC1/SC22/WG9/ARG, by Randall Brukardt, ARG Editor">
    <META NAME="GENERATOR" CONTENT="Arm_Form.Exe, Ada Reference Manual generator">
    <STYLE type="text/css">
    DIV.paranum {position: absolute; font-family: Arial, Helvetica, sans-serif; left: 0.5 em; top: auto}
    TT {font-family: "Courier New", monospace}
    DT {display: compact}
    DIV.Normal {font-family: "Times New Roman", Times, serif; margin-bottom: 0.6em}
    DIV.Wide {font-family: "Times New Roman", Times, serif; margin-top: 0.6em; margin-bottom: 0.6em}
    DIV.Annotations {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-bottom: 0.6em}
    DIV.WideAnnotations {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-top: 0.6em; margin-bottom: 0.6em}
    DIV.Index {font-family: "Times New Roman", Times, serif}
    DIV.SyntaxSummary {font-family: "Times New Roman", Times, serif; margin-left: 2.0em; margin-bottom: 0.4em}
    DIV.Notes {font-family: "Times New Roman", Times, serif; margin-left: 2.0em; margin-bottom: 0.6em}
    DIV.NotesHeader {font-family: "Times New Roman", Times, serif; margin-left: 2.0em}
    DIV.SyntaxIndented {font-family: "Times New Roman", Times, serif; margin-left: 2.0em; margin-bottom: 0.4em}
    DIV.Indented {font-family: "Times New Roman", Times, serif; margin-left: 6.0em; margin-bottom: 0.6em}
    DIV.CodeIndented {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-bottom: 0.6em}
    DIV.SmallIndented {font-family: "Times New Roman", Times, serif; margin-left:  10.0em; margin-bottom: 0.6em}
    DIV.SmallCodeIndented {font-family: "Times New Roman", Times, serif; margin-left: 8.0em; margin-bottom: 0.6em}
    DIV.Examples {font-family: "Courier New", monospace; margin-left: 2.0em; margin-bottom: 0.6em}
    DIV.SmallExamples {font-family: "Courier New", monospace; font-size: 80%; margin-left: 7.5em; margin-bottom: 0.6em}
    DIV.IndentedExamples {font-family: "Courier New", monospace; margin-left: 8.0em; margin-bottom: 0.6em}
    DIV.SmallIndentedExamples {font-family: "Courier New", monospace; font-size: 80%; margin-left:  15.0em; margin-bottom: 0.6em}
    UL.Bulleted {font-family: "Times New Roman", Times, serif; margin-left: 2.0em; margin-right: 2.0em; margin-top: 0em; margin-bottom: 0.5em}
    UL.SmallBulleted {font-family: "Times New Roman", Times, serif; margin-left: 6.0em; margin-right: 6.0em; margin-top: 0em; margin-bottom: 0.5em}
    UL.NestedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-right: 4.0em; margin-top: 0em; margin-bottom: 0.5em}
    UL.SmallNestedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 8.0em; margin-right: 8.0em; margin-top: 0em; margin-bottom: 0.5em}
    UL.IndentedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 8.0em; margin-right: 8.0em; margin-top: 0em; margin-bottom: 0.5em}
    UL.CodeIndentedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 6.0em; margin-right: 6.0em; margin-top: 0em; margin-bottom: 0.5em}
    UL.CodeIndentedNestedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 8.0em; margin-right: 8.0em; margin-top: 0em; margin-bottom: 0.5em}
    UL.SyntaxIndentedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-right: 4.0em; margin-top: 0em; margin-bottom: 0.5em}
    UL.NotesBulleted {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-right: 4.0em; margin-top: 0em; margin-bottom: 0.5em}
    UL.NotesNestedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 6.0em; margin-right: 6.0em; margin-top: 0em; margin-bottom: 0.5em}
    DL.Hanging {font-family: "Times New Roman", Times, serif; margin-top: 0em; margin-bottom: 0.6em}
    DD.Hanging {margin-left: 6.0em}
    DL.IndentedHanging {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-top: 0em; margin-bottom: 0.6em}
    DD.IndentedHanging {margin-left: 2.0em}
    DL.HangingInBulleted {font-family: "Times New Roman", Times, serif; margin-left: 2.0em; margin-right: 2.0em; margin-top: 0em; margin-bottom: 0.5em}
    DD.HangingInBulleted {margin-left: 4.0em}
    DL.SmallHanging {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-top: 0em; margin-bottom: 0.6em}
    DD.SmallHanging {margin-left: 7.5em}
    DL.SmallIndentedHanging {font-family: "Times New Roman", Times, serif; margin-left: 8.0em; margin-top: 0em; margin-bottom: 0.6em}
    DD.SmallIndentedHanging {margin-left: 2.0em}
    DL.SmallHangingInBulleted {font-family: "Times New Roman", Times, serif; margin-left: 6.0em; margin-right: 6.0em; margin-top: 0em; margin-bottom: 0.5em}
    DD.SmallHangingInBulleted {margin-left: 5.0em}
    DL.Enumerated {font-family: "Times New Roman", Times, serif; margin-right: 0.0em; margin-top: 0em; margin-bottom: 0.5em}
    DD.Enumerated {margin-left: 2.0em}
    DL.SmallEnumerated {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-right: 4.0em; margin-top: 0em; margin-bottom: 0.5em}
    DD.SmallEnumerated {margin-left: 2.5em}
    DL.NestedEnumerated {font-family: "Times New Roman", Times, serif; margin-left: 2.0em; margin-right: 2.0em; margin-top: 0em; margin-bottom: 0.5em}
    DL.SmallNestedEnumerated {font-family: "Times New Roman", Times, serif; margin-left: 6.0em; margin-right: 6.0em; margin-top: 0em; margin-bottom: 0.5em}
    </STYLE>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFF0" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
<P><A HREF="AA-TOC.html">Contents</A>&nbsp;&nbsp;&nbsp;<A HREF="AA-0-29.html">Index</A>&nbsp;&nbsp;&nbsp;<A HREF="AA-4-3.html">Previous</A>&nbsp;&nbsp;&nbsp;<A HREF="AA-4-3-2.html">Next</A></P>
<HR>
<H1> 4.3.1 Record Aggregates</H1>
<DIV Class="Paranum"><FONT SIZE=-2>1</FONT></DIV>
<DIV Class="Normal">&nbsp;&nbsp;&nbsp;[In a <FONT FACE="Arial, Helvetica">record_aggregate</FONT>,
a value is specified for each component of the record or record extension
value, using either a named or a positional association.] </DIV>

<H4 ALIGN=CENTER>Syntax</H4>
<DIV Class="Paranum"><FONT SIZE=-2>2</FONT></DIV>
<DIV Class="SyntaxIndented"><FONT FACE="Arial, Helvetica">record_aggregate<A NAME="I2367"></A>
::= </FONT>(<A NAME="I2368"></A><FONT FACE="Arial, Helvetica">record_component_association_list</FONT>)</DIV>
<DIV Class="Paranum"><FONT SIZE=-2>3</FONT></DIV>
<DIV Class="SyntaxIndented"><FONT FACE="Arial, Helvetica">record_component_association_list<A NAME="I2369"></A>
::= </FONT><BR>
&nbsp;&nbsp;&nbsp;&nbsp;<A NAME="I2370"></A><FONT FACE="Arial, Helvetica">record_component_association</FONT>&nbsp;{,&nbsp;<A NAME="I2371"></A><FONT FACE="Arial, Helvetica">record_component_association</FONT>}<BR>
&nbsp;&nbsp;|&nbsp;<B>null&nbsp;record</B></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>4</FONT></DIV>
<DIV Class="SyntaxIndented"><FONT FACE="Arial, Helvetica">record_component_association<A NAME="I2372"></A>
::= </FONT><BR>
&nbsp;&nbsp;&nbsp;[&nbsp;<A NAME="I2373"></A><FONT FACE="Arial, Helvetica">component_choice_list</FONT>&nbsp;=&gt;&nbsp;]&nbsp;<A NAME="I2374"></A><FONT FACE="Arial, Helvetica">expression</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>5</FONT></DIV>
<DIV Class="SyntaxIndented"><FONT FACE="Arial, Helvetica">component_choice_list<A NAME="I2375"></A>
::= </FONT><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<I>component_</I><A NAME="I2376"></A><FONT FACE="Arial, Helvetica">selector_name</FONT>&nbsp;{|&nbsp;<I>component_</I><A NAME="I2377"></A><FONT FACE="Arial, Helvetica">selector_name</FONT>}<BR>
&nbsp;&nbsp;&nbsp;|&nbsp;<B>others</B></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>6</FONT></DIV>
<DIV Class="SyntaxIndented"><A NAME="I2378"></A>A <FONT FACE="Arial, Helvetica">record_component_association</FONT>
is a <I>named component association</I> if it has a <FONT FACE="Arial, Helvetica">component_choice_list</FONT>;
<A NAME="I2379"></A>otherwise, it is a <I>positional component association</I>.
Any positional component associations shall precede any named component
associations. If there is a named association with a <FONT FACE="Arial, Helvetica">component_choice_list</FONT>
of <B>others</B>, it shall come last. </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>6.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>These rules
were implied by the BNF in an early version of the RM9X, but it made
the grammar harder to read, and was inconsistent with how we handle discriminant
constraints. Note that for array aggregates we still express some of
the rules in the grammar, but array aggregates are significantly different
because an array aggregate is either all positional (with a possible
<B>others</B> at the end), or all named. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>7</FONT></DIV>
<DIV Class="SyntaxIndented">In the <FONT FACE="Arial, Helvetica">record_component_association_list</FONT>
for a <FONT FACE="Arial, Helvetica">record_aggregate</FONT>, if there
is only one association, it shall be a named association. </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>7.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Reason: </B>Otherwise the construct
would be interpreted as a parenthesized expression. This is considered
a syntax rule, since it is relevant to overload resolution. We choose
not to express it with BNF so we can share the definition of <FONT FACE="Arial, Helvetica">record_component_association_list</FONT>
in both <FONT FACE="Arial, Helvetica">record_aggregate</FONT> and <FONT FACE="Arial, Helvetica">extension_aggregate</FONT>.
</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>7.b</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Ramification: </B>The <FONT FACE="Arial, Helvetica">record_component_association_list</FONT>
of an <FONT FACE="Arial, Helvetica">extension_aggregate</FONT> does not
have such a restriction. </FONT></DIV>

<H4 ALIGN=CENTER>Name Resolution Rules</H4>
<DIV Class="Paranum"><FONT SIZE=-2>8</FONT></DIV>
<DIV Class="Normal">&nbsp;&nbsp;&nbsp;<A NAME="I2380"></A>The expected type for a <FONT FACE="Arial, Helvetica">record_aggregate</FONT>
shall be a single nonlimited record type or record extension. </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>8.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Ramification: </B>This rule
is used to resolve whether an <FONT FACE="Arial, Helvetica">aggregate</FONT>
is an <FONT FACE="Arial, Helvetica">array_aggregate</FONT> or a <FONT FACE="Arial, Helvetica">record_aggregate</FONT>.
The presence of a <B>with</B> is used to resolve between a <FONT FACE="Arial, Helvetica">record_aggregate</FONT>
and an <FONT FACE="Arial, Helvetica">extension_aggregate</FONT>. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>9</FONT></DIV>
<DIV Class="Normal">&nbsp;&nbsp;&nbsp;<A NAME="I2381"></A>For the <FONT FACE="Arial, Helvetica">record_component_association_list</FONT>
of a <FONT FACE="Arial, Helvetica">record_aggregate</FONT>, all components
of the composite value defined by the aggregate are <I>needed</I>[; for
the association list of an <FONT FACE="Arial, Helvetica">extension_aggregate</FONT>,
only those components not determined by the ancestor expression or subtype
are needed (see <A HREF="AA-4-3-2.html">4.3.2</A>).] Each <FONT FACE="Arial, Helvetica">selector_name</FONT>
in a <FONT FACE="Arial, Helvetica">record_component_association</FONT>
shall denote a needed component [(including possibly a discriminant)].
</DIV>
<DIV Class="Paranum"><FONT SIZE=-2>9.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Ramification: </B>For the association
list of a <FONT FACE="Arial, Helvetica">record_aggregate</FONT>, ``needed
components'' includes every component of the composite value, but does
not include those in unchosen <FONT FACE="Arial, Helvetica">variant</FONT>s
(see AI83-309). If there are <FONT FACE="Arial, Helvetica">variant</FONT>s,
then the value specified for the discriminant that governs them determines
which <FONT FACE="Arial, Helvetica">variant</FONT> is chosen, and hence
which components are needed.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>9.b</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>If an extension defines a new
<FONT FACE="Arial, Helvetica">known_discriminant_part</FONT>, then all
of its discriminants are needed in the component association list of
an extension aggregate for that type, even if the discriminants have
the same names and types as discriminants of the type of the ancestor
expression. This is necessary to ensure that the positions in the <FONT FACE="Arial, Helvetica">record_component_association_list</FONT>
are well defined, and that discriminants that govern <FONT FACE="Arial, Helvetica">variant_part</FONT>s
can be given by static expressions. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>10</FONT></DIV>
<DIV Class="Normal" Style="margin-bottom: 0.4em">&nbsp;&nbsp;&nbsp;&nbsp;<A NAME="I2382"></A>The
expected type for the <FONT FACE="Arial, Helvetica">expression</FONT>
of a <FONT FACE="Arial, Helvetica">record_component_association</FONT>
is the type of the <I>associated</I> component(s); <A NAME="I2383"></A>the
associated component(s) are as follows: </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>11</FONT></DIV>
<UL Class="Bulleted"><LI TYPE=DISC>For a positional association, the component [(including
possibly a discriminant)] in the corresponding relative position (in
the declarative region of the type), counting only the needed components;
</LI></UL>
<DIV Class="Paranum"><FONT SIZE=-2>11.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Ramification: </B>This means
that for an association list of an <FONT FACE="Arial, Helvetica">extension_aggregate</FONT>,
only noninherited components are counted to determine the position. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>12</FONT></DIV>
<UL Class="Bulleted"><LI TYPE=DISC>For a named association with one or more <I>component_</I><FONT FACE="Arial, Helvetica">selector_name</FONT>s,
the named component(s);</LI></UL>
<DIV Class="Paranum"><FONT SIZE=-2>13</FONT></DIV>
<UL Class="Bulleted"><LI TYPE=DISC>For a named association with the reserved word <B>others</B>,
all needed components that are not associated with some previous association.
</LI></UL>

<H4 ALIGN=CENTER>Legality Rules</H4>
<DIV Class="Paranum"><FONT SIZE=-2>14</FONT></DIV>
<DIV Class="Normal">&nbsp;&nbsp;&nbsp;&nbsp;If the type of a <FONT FACE="Arial, Helvetica">record_aggregate</FONT>
is a record extension, then it shall be a descendant of a record type,
through one or more record extensions (and no private extensions).</DIV>
<DIV Class="Paranum"><FONT SIZE=-2>15</FONT></DIV>
<DIV Class="Normal">&nbsp;&nbsp;&nbsp;&nbsp;If there are no components needed in a given
<FONT FACE="Arial, Helvetica">record_component_association_list</FONT>,
then the reserved words <B>null record</B> shall appear rather than a
list of <FONT FACE="Arial, Helvetica">record_component_association</FONT>s.
</DIV>
<DIV Class="Paranum"><FONT SIZE=-2>15.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Ramification: </B>For example,
&quot;(<B>null record</B>)&quot; is a <FONT FACE="Arial, Helvetica">record_aggregate</FONT>
for a null record type. Similarly, &quot;(T'(A) <B>with null record</B>)&quot;
is an <FONT FACE="Arial, Helvetica">extension_aggregate</FONT> for a
type defined as a null record extension of T. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>16</FONT></DIV>
<DIV Class="Normal">&nbsp;&nbsp;&nbsp;&nbsp;Each <FONT FACE="Arial, Helvetica">record_component_association</FONT>
shall have at least one associated component, and each needed component
shall be associated with exactly one <FONT FACE="Arial, Helvetica">record_component_association</FONT>.
If a <FONT FACE="Arial, Helvetica">record_component_association</FONT>
has two or more associated components, all of them shall be of the same
type. </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>16.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Ramification: </B>These rules
apply to an association with an <B>others</B> choice. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>16.b</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Reason: </B>Without these rules,
there would be no way to know what was the expected type for the <FONT FACE="Arial, Helvetica">expression</FONT>
of the association. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>16.c</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>AI83-00244
also requires that the <FONT FACE="Arial, Helvetica">expression</FONT>
shall be legal for each associated component. This is because even though
two components have the same type, they might have different subtypes.
Therefore, the legality of the <FONT FACE="Arial, Helvetica">expression</FONT>,
particularly if it is an array aggregate, might differ depending on the
associated component's subtype. However, we have relaxed the rules on
array aggregates slightly for Ada 95, so the staticness of an applicable
index constraint has no effect on the legality of the array aggregate
to which it applies. See <A HREF="AA-4-3-3.html">4.3.3</A>. This was
the only case (that we know of) where a subtype provided by context affected
the legality of an <FONT FACE="Arial, Helvetica">expression</FONT>. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>16.d</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Ramification: </B>The rule
that requires at least one associated component for each <FONT FACE="Arial, Helvetica">record_component_association</FONT>
implies that there can be no extra associations for components that don't
exist in the composite value, or that are already determined by the ancestor
expression or subtype of an <FONT FACE="Arial, Helvetica">extension_aggregate</FONT>.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>16.e</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>The second part of the first sentence
ensures that no needed components are left out, nor specified twice.
</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>17</FONT></DIV>
<DIV Class="Normal">&nbsp;&nbsp;&nbsp;&nbsp;If the components of a <FONT FACE="Arial, Helvetica">variant_part</FONT>
are needed, then the value of a discriminant that governs the <FONT FACE="Arial, Helvetica">variant_part</FONT>
shall be given by a static expression. </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>17.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Ramification: </B>This expression
might either be given within the aggregate itself, or in a constraint
on the parent subtype in a <FONT FACE="Arial, Helvetica">derived_type_definition</FONT>
for some ancestor of the type of the aggregate. </FONT></DIV>

<H4 ALIGN=CENTER>Dynamic Semantics</H4>
<DIV Class="Paranum"><FONT SIZE=-2>18</FONT></DIV>
<DIV Class="Normal">&nbsp;&nbsp;&nbsp;&nbsp;<A NAME="I2384"></A>The evaluation of a <FONT FACE="Arial, Helvetica">record_aggregate</FONT>
consists of the evaluation of the <FONT FACE="Arial, Helvetica">record_component_association_list</FONT>.</DIV>
<DIV Class="Paranum"><FONT SIZE=-2>19</FONT></DIV>
<DIV Class="Normal">&nbsp;&nbsp;&nbsp;&nbsp;<A NAME="I2385"></A>For the evaluation of a <FONT FACE="Arial, Helvetica">record_component_association_list</FONT>,
any per-object constraints (see <A HREF="AA-3-8.html">3.8</A>) for components
specified in the association list are elaborated and any <FONT FACE="Arial, Helvetica">expression</FONT>s
are evaluated and converted to the subtype of the associated component.
<A NAME="I2386"></A>Any constraint elaborations and <FONT FACE="Arial, Helvetica">expression</FONT>
evaluations (and conversions) occur in an arbitrary order, except that
the <FONT FACE="Arial, Helvetica">expression</FONT> for a discriminant
is evaluated (and converted) prior to the elaboration of any per-object
constraint that depends on it, which in turn occurs prior to the evaluation
and conversion of the <FONT FACE="Arial, Helvetica">expression</FONT>
for the component with the per-object constraint. </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>19.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Ramification: </B>The conversion
in the first rule might raise Constraint_Error. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>19.b</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>This check
in the first rule presumably happened as part of the dependent compatibility
check in Ada 83. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>20</FONT></DIV>
<DIV Class="Normal">&nbsp;&nbsp;&nbsp;&nbsp;The <FONT FACE="Arial, Helvetica">expression</FONT>
of a <FONT FACE="Arial, Helvetica">record_component_association</FONT>
is evaluated (and converted) once for each associated component.</DIV>
<DIV Class="NotesHeader"><FONT SIZE=-1>NOTES</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>21</FONT></DIV>
<DIV Class="Notes"><FONT SIZE=-1>7&nbsp;&nbsp;For a <FONT FACE="Arial, Helvetica">record_aggregate</FONT>
with positional associations, expressions specifying discriminant values
appear first since the <FONT FACE="Arial, Helvetica">known_discriminant_part</FONT>
is given first in the declaration of the type; they have to be in the
same order as in the <FONT FACE="Arial, Helvetica">known_discriminant_part</FONT>.
</FONT></DIV>

<H4 ALIGN=CENTER>Examples</H4>
<DIV Class="Paranum"><FONT SIZE=-2>22</FONT></DIV>
<DIV Class="Normal" Style="margin-bottom: 0.4em">&nbsp;&nbsp;&nbsp;&nbsp;<I>Example of a
record aggregate with positional associations:</I> </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>23</FONT></DIV>
<DIV Class="Examples"><TT>(4,&nbsp;July,&nbsp;1776)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<I>--&nbsp;&nbsp;see&nbsp;<A HREF="AA-3-8.html">3.8</A>&nbsp;</I></TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>24</FONT></DIV>
<DIV Class="Wide" Style="margin-bottom: 0.4em">&nbsp;&nbsp;&nbsp;&nbsp;<I>Examples of record
aggregates with named associations:</I> </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>25</FONT></DIV>
<DIV Class="Examples"><TT>(Day&nbsp;=&gt;&nbsp;4,&nbsp;Month&nbsp;=&gt;&nbsp;July,&nbsp;Year&nbsp;=&gt;&nbsp;1776)<BR>
(Month&nbsp;=&gt;&nbsp;July,&nbsp;Day&nbsp;=&gt;&nbsp;4,&nbsp;Year&nbsp;=&gt;&nbsp;1776)</TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>26</FONT></DIV>
<DIV Class="Examples"><TT>(Disk,&nbsp;Closed,&nbsp;Track&nbsp;=&gt;&nbsp;5,&nbsp;Cylinder&nbsp;=&gt;&nbsp;12)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<I>--&nbsp;&nbsp;see&nbsp;<A HREF="AA-3-8-1.html">3.8.1</A></I><BR>
(Unit&nbsp;=&gt;&nbsp;Disk,&nbsp;Status&nbsp;=&gt;&nbsp;Closed,&nbsp;Cylinder&nbsp;=&gt;&nbsp;9,&nbsp;Track&nbsp;=&gt;&nbsp;1)</TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>27</FONT></DIV>
<DIV Class="Wide" Style="margin-bottom: 0.4em">&nbsp;&nbsp;&nbsp;&nbsp;<I>Example of component
association with several choices:</I> </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>28</FONT></DIV>
<DIV Class="Examples"><TT>(Value&nbsp;=&gt;&nbsp;0,&nbsp;Succ|Pred&nbsp;=&gt;&nbsp;<B>new</B>&nbsp;Cell'(0,&nbsp;<B>null</B>,&nbsp;<B>null</B>))&nbsp;&nbsp;&nbsp;<I>--&nbsp;&nbsp;see&nbsp;<A HREF="AA-3-10-1.html">3.10.1</A></I></TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>29</FONT></DIV>
<DIV Class="Examples"><TT>&nbsp;<I>--&nbsp;&nbsp;The&nbsp;allocator&nbsp;is&nbsp;evaluated&nbsp;twice:&nbsp;Succ&nbsp;and&nbsp;Pred&nbsp;designate&nbsp;different&nbsp;cells</I></TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>30</FONT></DIV>
<DIV Class="Wide" Style="margin-bottom: 0.4em">&nbsp;&nbsp;&nbsp;&nbsp;<I>Examples of record
aggregates for tagged types (see <A HREF="AA-3-9.html">3.9</A> and <A HREF="AA-3-9-1.html">3.9.1</A>):</I>
</DIV>
<DIV Class="Paranum"><FONT SIZE=-2>31</FONT></DIV>
<DIV Class="Examples"><TT>Expression'(<B>null&nbsp;record</B>)<BR>
Literal'(Value&nbsp;=&gt;&nbsp;0.0)<BR>
Painted_Point'(0.0,&nbsp;Pi/2.0,&nbsp;Paint&nbsp;=&gt;&nbsp;Red)</TT></DIV>

<H4 ALIGN=CENTER>Extensions to Ada 83</H4>
<DIV Class="Paranum"><FONT SIZE=-2>31.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><A NAME="I2387"></A>Null record
aggregates may now be specified, via &quot;(<B>null record</B>)&quot;.
However, this syntax is more useful for null record extensions in extension
aggregates. </FONT></DIV>

<H4 ALIGN=CENTER>Wording Changes from Ada 83</H4>
<DIV Class="Paranum"><FONT SIZE=-2>31.b</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>Various AIs have been incorporated
(AI83-00189, AI83-00244, and AI83-00309). In particular, Ada 83 did not
explicitly disallow extra values in a record aggregate. Now we do. </FONT></DIV>

<HR>
<P><A HREF="AA-TOC.html">Contents</A>&nbsp;&nbsp;&nbsp;<A HREF="AA-0-29.html">Index</A>&nbsp;&nbsp;&nbsp;<A HREF="AA-4-3.html">Previous</A>&nbsp;&nbsp;&nbsp;<A HREF="AA-4-3-2.html">Next</A>&nbsp;&nbsp;&nbsp;<A HREF="AA-TTL.html">Legal</A></P>
</BODY>
</HTML>