@@ -2225,7 +2225,8 @@ \subsection{Formal Parameters}
2225
2225
\Index{formal parameter list},
2226
2226
which consists of a list of required positional parameters
2227
2227
(\ref{requiredFormals}),
2228
- followed by any optional and/or named parameters (\ref{optionalFormals}).
2228
+ followed by any optional and/or named parameters
2229
+ (\ref{optionalFormalsAndNamedFormals}).
2229
2230
The latter may be specified
2230
2231
either as a list of optional positional parameters,
2231
2232
or as a set of named parameters,
@@ -2429,8 +2430,14 @@ \subsubsection{Required Formals}
2429
2430
an instance method, instance setter, or instance operator.
2430
2431
2431
2432
2432
- \subsubsection{Optional and Named Formals}
2433
- \LMLabel{optionalFormals}
2433
+ \subsubsection{Optional Formals and Named Formals}
2434
+ \LMLabel{optionalFormalsAndNamedFormals}
2435
+
2436
+ \LMHash{}%
2437
+ This section is concerned with optional parameters,
2438
+ positional or named,
2439
+ and with required named parameters.
2440
+ They are handled together because they share grammar rules.
2434
2441
2435
2442
\LMHash{}%
2436
2443
Optional formal parameters may be specified and provided with default values.
@@ -2442,7 +2449,7 @@ \subsubsection{Optional and Named Formals}
2442
2449
2443
2450
<defaultNamedParameter> ::= \gnewline{}
2444
2451
<metadata> \REQUIRED? <normalFormalParameterNoMetadata>
2445
- \gnewline{} (`: ' <expression>)?
2452
+ \gnewline{} (`= ' <expression>)?
2446
2453
\end{grammar}
2447
2454
2448
2455
\LMHash{}%
@@ -2460,7 +2467,7 @@ \subsubsection{Optional and Named Formals}
2460
2467
\Error{compile-time error} if a required named parameter has a default value.
2461
2468
2462
2469
\LMHash{}%
2463
- Assume that $p$ is an optional named parameter with default value $d$.
2470
+ Assume that $p$ is an optional parameter with default value $d$.
2464
2471
It is a \Error{compile-time error}
2465
2472
if the static type of $d$ is not assignable to the declared type of $p$.
2466
2473
0 commit comments