@@ -2240,7 +2240,8 @@ \subsection{Formal Parameters}
2240
2240
\Index{formal parameter list},
2241
2241
which consists of a list of required positional parameters
2242
2242
(\ref{requiredFormals}),
2243
- followed by any optional and/or named parameters (\ref{optionalFormals}).
2243
+ followed by any optional and/or named parameters
2244
+ (\ref{optionalFormalsAndNamedFormals}).
2244
2245
The latter may be specified
2245
2246
either as a list of optional positional parameters,
2246
2247
or as a set of named parameters,
@@ -2444,8 +2445,14 @@ \subsubsection{Required Formals}
2444
2445
an instance method, instance setter, or instance operator.
2445
2446
2446
2447
2447
- \subsubsection{Optional and Named Formals}
2448
- \LMLabel{optionalFormals}
2448
+ \subsubsection{Optional Formals and Named Formals}
2449
+ \LMLabel{optionalFormalsAndNamedFormals}
2450
+
2451
+ \LMHash{}%
2452
+ This section is concerned with optional parameters,
2453
+ positional or named,
2454
+ and with required named parameters.
2455
+ They are handled together because they share grammar rules.
2449
2456
2450
2457
\LMHash{}%
2451
2458
Optional formal parameters may be specified and provided with default values.
@@ -2457,7 +2464,7 @@ \subsubsection{Optional and Named Formals}
2457
2464
2458
2465
<defaultNamedParameter> ::= \gnewline{}
2459
2466
<metadata> \REQUIRED? <normalFormalParameterNoMetadata>
2460
- \gnewline{} (`: ' <expression>)?
2467
+ \gnewline{} (`= ' <expression>)?
2461
2468
\end{grammar}
2462
2469
2463
2470
\LMHash{}%
@@ -2475,7 +2482,7 @@ \subsubsection{Optional and Named Formals}
2475
2482
\Error{compile-time error} if a required named parameter has a default value.
2476
2483
2477
2484
\LMHash{}%
2478
- Assume that $p$ is an optional named parameter with default value $d$.
2485
+ Assume that $p$ is an optional parameter with default value $d$.
2479
2486
It is a \Error{compile-time error}
2480
2487
if the static type of $d$ is not assignable to the declared type of $p$.
2481
2488
0 commit comments