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