File: AA-6-4.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 (276 lines) | stat: -rw-r--r-- 22,235 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
    <TITLE>AARM95 - Subprogram Calls</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-6-3-2.html">Previous</A>&nbsp;&nbsp;&nbsp;<A HREF="AA-6-4-1.html">Next</A></P>
<HR>
<H1> 6.4 Subprogram Calls</H1>
<DIV Class="Paranum"><FONT SIZE=-2>1</FONT></DIV>
<DIV Class="Normal">&nbsp;&nbsp;&nbsp;<A NAME="I3123"></A>A <I>subprogram call</I> is
either a <FONT FACE="Arial, Helvetica">procedure_call_statement</FONT>
or a <FONT FACE="Arial, Helvetica">function_call</FONT>; [it invokes
the execution of the <FONT FACE="Arial, Helvetica">subprogram_body</FONT>.
The call specifies the association of the actual parameters, if any,
with formal parameters of the subprogram.] </DIV>

<H4 ALIGN=CENTER>Syntax</H4>
<DIV Class="Paranum"><FONT SIZE=-2>2</FONT></DIV>
<DIV Class="SyntaxIndented"><FONT FACE="Arial, Helvetica">procedure_call_statement<A NAME="I3124"></A>
::= </FONT><BR>
&nbsp;&nbsp;&nbsp;&nbsp;<I>procedure_</I><A NAME="I3125"></A><FONT FACE="Arial, Helvetica">name</FONT>;<BR>
&nbsp;&nbsp;|&nbsp;<I>procedure_</I><A NAME="I3126"></A><FONT FACE="Arial, Helvetica">prefix</FONT>&nbsp;<A NAME="I3127"></A><FONT FACE="Arial, Helvetica">actual_parameter_part</FONT>;</DIV>
<DIV Class="Paranum"><FONT SIZE=-2>3</FONT></DIV>
<DIV Class="SyntaxIndented"><FONT FACE="Arial, Helvetica">function_call<A NAME="I3128"></A>
::= </FONT><BR>
&nbsp;&nbsp;&nbsp;&nbsp;<I>function_</I><A NAME="I3129"></A><FONT FACE="Arial, Helvetica">name</FONT><BR>
&nbsp;&nbsp;|&nbsp;<I>function_</I><A NAME="I3130"></A><FONT FACE="Arial, Helvetica">prefix</FONT>&nbsp;<A NAME="I3131"></A><FONT FACE="Arial, Helvetica">actual_parameter_part</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>4</FONT></DIV>
<DIV Class="SyntaxIndented"><FONT FACE="Arial, Helvetica">actual_parameter_part<A NAME="I3132"></A>
::= </FONT><BR>
&nbsp;&nbsp;&nbsp;&nbsp;(<A NAME="I3133"></A><FONT FACE="Arial, Helvetica">parameter_association</FONT>&nbsp;{,&nbsp;<A NAME="I3134"></A><FONT FACE="Arial, Helvetica">parameter_association</FONT>})</DIV>
<DIV Class="Paranum"><FONT SIZE=-2>5</FONT></DIV>
<DIV Class="SyntaxIndented"><FONT FACE="Arial, Helvetica">parameter_association<A NAME="I3135"></A>
::= </FONT><BR>
&nbsp;&nbsp;&nbsp;[<I>formal_parameter_</I><A NAME="I3136"></A><FONT FACE="Arial, Helvetica">selector_name</FONT>&nbsp;=&gt;]&nbsp;<A NAME="I3137"></A><FONT FACE="Arial, Helvetica">explicit_actual_parameter</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>6</FONT></DIV>
<DIV Class="SyntaxIndented"><FONT FACE="Arial, Helvetica">explicit_actual_parameter<A NAME="I3138"></A>
::= </FONT><A NAME="I3139"></A><FONT FACE="Arial, Helvetica">expression</FONT>&nbsp;|&nbsp;<I>variable_</I><A NAME="I3140"></A><FONT FACE="Arial, Helvetica">name</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>7</FONT></DIV>
<DIV Class="SyntaxIndented"><A NAME="I3141"></A><A NAME="I3142"></A>A
<FONT FACE="Arial, Helvetica">parameter_association</FONT> is <I>named</I>
or <I>positional</I> according to whether or not the <I>formal_parameter_</I><FONT FACE="Arial, Helvetica">selector_name</FONT>
is specified. Any positional associations shall precede any named associations.
Named associations are not allowed if the <FONT FACE="Arial, Helvetica">prefix</FONT>
in a subprogram call is an <FONT FACE="Arial, Helvetica">attribute_reference</FONT>.
</DIV>
<DIV Class="Paranum"><FONT SIZE=-2>7.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Ramification: </B>This means
that the formal parameter names used in describing predefined attributes
are to aid presentation of their semantics, but are not intended for
use in actual calls. </FONT></DIV>

<H4 ALIGN=CENTER>Name Resolution Rules</H4>
<DIV Class="Paranum"><FONT SIZE=-2>8</FONT></DIV>
<DIV Class="Normal">&nbsp;&nbsp;&nbsp;The <FONT FACE="Arial, Helvetica">name</FONT>
or <FONT FACE="Arial, Helvetica">prefix</FONT> given in a <FONT FACE="Arial, Helvetica">procedure_call_statement</FONT>
shall resolve to denote a callable entity that is a procedure, or an
entry renamed as (viewed as) a procedure. The <FONT FACE="Arial, Helvetica">name</FONT>
or <FONT FACE="Arial, Helvetica">prefix</FONT> given in a <FONT FACE="Arial, Helvetica">function_call</FONT>
shall resolve to denote a callable entity that is a function. [When there
is an <FONT FACE="Arial, Helvetica">actual_parameter_part</FONT>, the
<FONT FACE="Arial, Helvetica">prefix</FONT> can be an <FONT FACE="Arial, Helvetica">implicit_dereference</FONT>
of an access-to-subprogram value.] </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>8.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Ramification: </B>The function
can be an operator, enumeration literal, attribute that is a function,
etc. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>9</FONT></DIV>
<DIV Class="Normal">&nbsp;&nbsp;&nbsp;A subprogram call shall contain at most one association
for each formal parameter. Each formal parameter without an association
shall have a <FONT FACE="Arial, Helvetica">default_expression</FONT>
(in the profile of the view denoted by the <FONT FACE="Arial, Helvetica">name</FONT>
or <FONT FACE="Arial, Helvetica">prefix</FONT>). This rule is an overloading
rule (see <A HREF="AA-8-6.html">8.6</A>). </DIV>

<H4 ALIGN=CENTER>Dynamic Semantics</H4>
<DIV Class="Paranum"><FONT SIZE=-2>10</FONT></DIV>
<DIV Class="Normal">&nbsp;&nbsp;&nbsp;&nbsp;<A NAME="I3143"></A>For the execution of a subprogram
call, the <FONT FACE="Arial, Helvetica">name</FONT> or <FONT FACE="Arial, Helvetica">prefix</FONT>
of the call is evaluated, and each <FONT FACE="Arial, Helvetica">parameter_association</FONT>
is evaluated (see <A HREF="AA-6-4-1.html">6.4.1</A>). If a <FONT FACE="Arial, Helvetica">default_expression</FONT>
is used, an implicit <FONT FACE="Arial, Helvetica">parameter_association</FONT>
is assumed for this rule. These evaluations are done in an arbitrary
order. The <FONT FACE="Arial, Helvetica">subprogram_body</FONT> 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 <A HREF="AA-6-4-1.html">6.4.1</A>). </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>10.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>The implicit
association for a default is only for this run-time rule. At compile
time, the visibility rules are applied to the default at the place where
it occurs, not at the place of a call. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>10.b</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>To be honest: </B>If the subprogram
is inherited, see <A HREF="AA-3-4.html">3.4</A>, ``<A HREF="AA-3-4.html">Derived
Types and Classes</A>''.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>10.c</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>If the subprogram is protected,
see <A HREF="AA-9-5-1.html">9.5.1</A>, ``<A HREF="AA-9-5-1.html">Protected
Subprograms and Protected Actions</A>''.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>10.d</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>If the subprogram is really a
renaming of an entry, see <A HREF="AA-9-5-3.html">9.5.3</A>, ``<A HREF="AA-9-5-3.html">Entry
Calls</A>''.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>10.e</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>Normally, the <FONT FACE="Arial, Helvetica">subprogram_body</FONT>
that is executed by the above rule is the one for the subprogram being
called. For an enumeration literal, implicitly declared (but noninherited)
subprogram, or an attribute that is a subprogram, an implicit body is
assumed. For a dispatching call, <A HREF="AA-3-9-2.html">3.9.2</A>, ``<A HREF="AA-3-9-2.html">Dispatching
Operations of Tagged Types</A>'' defines which <FONT FACE="Arial, Helvetica">subprogram_body</FONT>
is executed. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>11</FONT></DIV>
<DIV Class="Normal">&nbsp;&nbsp;&nbsp;&nbsp;<A NAME="I3144"></A>The exception Program_Error
is raised at the point of a <FONT FACE="Arial, Helvetica">function_call</FONT>
if the function completes normally without executing a <FONT FACE="Arial, Helvetica">return_statement</FONT>.
</DIV>
<DIV Class="Paranum"><FONT SIZE=-2>11.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>We are committing
to raising the exception at the point of call, for uniformity -- see
AI83-00152. This happens after the function is left, of course.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>11.b</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>Note that there is no name for
suppressing this check, since the check imposes no time overhead and
minimal space overhead (since it can usually be statically eliminated
as dead code). </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>12</FONT></DIV>
<DIV Class="Normal">&nbsp;&nbsp;&nbsp;&nbsp;A <FONT FACE="Arial, Helvetica">function_call</FONT>
denotes a constant, as defined in <A HREF="AA-6-5.html">6.5</A>; the
nominal subtype of the constant is given by the result subtype of the
function. <A NAME="I3145"></A><A NAME="I3146"></A></DIV>

<H4 ALIGN=CENTER>Examples</H4>
<DIV Class="Paranum"><FONT SIZE=-2>13</FONT></DIV>
<DIV Class="Normal" Style="margin-bottom: 0.4em">&nbsp;&nbsp;&nbsp;&nbsp;<I>Examples of
procedure calls:</I> </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>14</FONT></DIV>
<DIV Class="Examples"><TT>Traverse_Tree;&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--<I>&nbsp;&nbsp;see&nbsp;<A HREF="AA-6-1.html">6.1</A></I><BR>
Print_Header(128,&nbsp;Title,&nbsp;True);&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-6-1.html">6.1</A></I></TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>15</FONT></DIV>
<DIV Class="Examples"><TT>Switch(From&nbsp;=&gt;&nbsp;X,&nbsp;To&nbsp;=&gt;&nbsp;Next);&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-6-1.html">6.1</A></I><BR>
Print_Header(128,&nbsp;Header&nbsp;=&gt;&nbsp;Title,&nbsp;Center&nbsp;=&gt;&nbsp;True);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--<I>&nbsp;&nbsp;see&nbsp;<A HREF="AA-6-1.html">6.1</A></I><BR>
Print_Header(Header&nbsp;=&gt;&nbsp;Title,&nbsp;Center&nbsp;=&gt;&nbsp;True,&nbsp;Pages&nbsp;=&gt;&nbsp;128);&nbsp;--<I>&nbsp;&nbsp;see&nbsp;<A HREF="AA-6-1.html">6.1</A></I></TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>16</FONT></DIV>
<DIV Class="Wide" Style="margin-bottom: 0.4em">&nbsp;&nbsp;&nbsp;&nbsp;<I>Examples of function
calls:</I> </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>17</FONT></DIV>
<DIV Class="Examples"><TT>Dot_Product(U,&nbsp;V)&nbsp;&nbsp;&nbsp;--<I>&nbsp;&nbsp;see&nbsp;<A HREF="AA-6-1.html">6.1</A>&nbsp;and&nbsp;<A HREF="AA-6-3.html">6.3</A></I><BR>
Clock&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--<I>&nbsp;&nbsp;see&nbsp;<A HREF="AA-9-6.html">9.6</A></I><BR>
F.<B>all</B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--<I>&nbsp;&nbsp;presuming&nbsp;F&nbsp;is&nbsp;of&nbsp;an&nbsp;access-to-subprogram&nbsp;type&nbsp;--&nbsp;see&nbsp;<A HREF="AA-3-10.html">3.10</A></I></TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>18</FONT></DIV>
<DIV Class="Wide" Style="margin-bottom: 0.4em">&nbsp;&nbsp;&nbsp;&nbsp;<I>Examples of procedures
with default expressions:</I> </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>19</FONT></DIV>
<DIV Class="Examples"><TT><B>procedure</B>&nbsp;Activate(Process&nbsp;:&nbsp;<B>in</B>&nbsp;Process_Name;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;After&nbsp;&nbsp;&nbsp;:&nbsp;<B>in</B>&nbsp;Process_Name&nbsp;:=&nbsp;No_Process;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Wait&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;<B>in</B>&nbsp;Duration&nbsp;:=&nbsp;0.0;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Prior&nbsp;&nbsp;&nbsp;:&nbsp;<B>in</B>&nbsp;Boolean&nbsp;:=&nbsp;False);</TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>20</FONT></DIV>
<DIV Class="Examples"><TT><B>procedure</B>&nbsp;Pair(Left,&nbsp;Right&nbsp;:&nbsp;<B>in</B>&nbsp;Person_Name&nbsp;:=&nbsp;<B>new</B>&nbsp;Person);&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>21</FONT></DIV>
<DIV Class="Wide" Style="margin-bottom: 0.4em">&nbsp;&nbsp;&nbsp;&nbsp;<I>Examples of their
calls:</I> </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>22</FONT></DIV>
<DIV Class="Examples"><TT>Activate(X);<BR>
Activate(X,&nbsp;After&nbsp;=&gt;&nbsp;Y);<BR>
Activate(X,&nbsp;Wait&nbsp;=&gt;&nbsp;60.0,&nbsp;Prior&nbsp;=&gt;&nbsp;True);<BR>
Activate(X,&nbsp;Y,&nbsp;10.0,&nbsp;False);</TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>23</FONT></DIV>
<DIV Class="Examples"><TT>Pair;<BR>
Pair(Left&nbsp;=&gt;&nbsp;<B>new</B>&nbsp;Person,&nbsp;Right&nbsp;=&gt;&nbsp;<B>new</B>&nbsp;Person);</TT></DIV>
<DIV Class="NotesHeader"><FONT SIZE=-1>NOTES</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>24</FONT></DIV>
<DIV Class="Notes"><FONT SIZE=-1>7&nbsp;&nbsp;If a <FONT FACE="Arial, Helvetica">default_expression</FONT>
is used for two or more parameters in a multiple <FONT FACE="Arial, Helvetica">parameter_specification</FONT>,
the <FONT FACE="Arial, Helvetica">default_expression</FONT> is evaluated
once for each omitted parameter. Hence in the above examples, the two
calls of Pair are equivalent. </FONT></DIV>

<H4 ALIGN=CENTER>Examples</H4>
<DIV Class="Paranum"><FONT SIZE=-2>25</FONT></DIV>
<DIV Class="Normal" Style="margin-bottom: 0.4em">&nbsp;&nbsp;&nbsp;&nbsp;<I>Examples of
overloaded subprograms:</I> </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>26</FONT></DIV>
<DIV Class="Examples"><TT><B>procedure</B>&nbsp;Put(X&nbsp;:&nbsp;<B>in</B>&nbsp;Integer);<BR>
<B>procedure</B>&nbsp;Put(X&nbsp;:&nbsp;<B>in</B>&nbsp;String);</TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>27</FONT></DIV>
<DIV Class="Examples"><TT><B>procedure</B>&nbsp;Set(Tint&nbsp;&nbsp;&nbsp;:&nbsp;<B>in</B>&nbsp;Color);<BR>
<B>procedure</B>&nbsp;Set(Signal&nbsp;:&nbsp;<B>in</B>&nbsp;Light);</TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>28</FONT></DIV>
<DIV Class="Wide" Style="margin-bottom: 0.4em">&nbsp;&nbsp;&nbsp;&nbsp;<I>Examples of their
calls:</I> </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>29</FONT></DIV>
<DIV Class="Examples"><TT>Put(28);<BR>
Put(&quot;no&nbsp;possible&nbsp;ambiguity&nbsp;here&quot;);</TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>30</FONT></DIV>
<DIV Class="Examples"><TT>Set(Tint&nbsp;&nbsp;&nbsp;=&gt;&nbsp;Red);<BR>
Set(Signal&nbsp;=&gt;&nbsp;Red);<BR>
Set(Color'(Red));</TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>31</FONT></DIV>
<DIV Class="Examples"><TT>--<I>&nbsp;&nbsp;Set(Red)&nbsp;would&nbsp;be&nbsp;ambiguous&nbsp;since&nbsp;Red&nbsp;may</I><BR>
--<I>&nbsp;&nbsp;denote&nbsp;a&nbsp;value&nbsp;either&nbsp;of&nbsp;type&nbsp;Color&nbsp;or&nbsp;of&nbsp;type&nbsp;Light</I></TT></DIV>

<H4 ALIGN=CENTER>Wording Changes from Ada 83</H4>
<DIV Class="Paranum"><FONT SIZE=-2>31.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>We have gotten rid of parameters
``of the form of a type conversion'' (see RM83-6.4.1(3)). The new view
semantics of <FONT FACE="Arial, Helvetica">type_conversion</FONT>s allows
us to use normal <FONT FACE="Arial, Helvetica">type_conversion</FONT>s
instead.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>31.b</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>We have moved wording about run-time
semantics of parameter associations to <A HREF="AA-6-4-1.html">6.4.1</A>.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>31.c</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>We have moved wording about raising
Program_Error for a function that falls off the end to here from RM83-6.5.
</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-6-3-2.html">Previous</A>&nbsp;&nbsp;&nbsp;<A HREF="AA-6-4-1.html">Next</A>&nbsp;&nbsp;&nbsp;<A HREF="AA-TTL.html">Legal</A></P>
</BODY>
</HTML>