@@ -2294,7 +2294,8 @@ \subsection{Formal Parameters}
2294
2294
\Index{formal parameter list},
2295
2295
which consists of a list of required positional parameters
2296
2296
(\ref{requiredFormals}),
2297
- followed by any optional and/or named parameters (\ref{optionalFormals}).
2297
+ followed by any optional and/or named parameters
2298
+ (\ref{optionalFormalsAndNamedFormals}).
2298
2299
The latter may be specified
2299
2300
either as a list of optional positional parameters,
2300
2301
or as a set of named parameters,
@@ -2498,8 +2499,14 @@ \subsubsection{Required Formals}
2498
2499
an instance method, instance setter, or instance operator.
2499
2500
2500
2501
2501
- \subsubsection{Optional and Named Formals}
2502
- \LMLabel{optionalFormals}
2502
+ \subsubsection{Optional Formals and Named Formals}
2503
+ \LMLabel{optionalFormalsAndNamedFormals}
2504
+
2505
+ \LMHash{}%
2506
+ This section is concerned with optional parameters,
2507
+ positional or named,
2508
+ and with required named parameters.
2509
+ They are handled together because they share grammar rules.
2503
2510
2504
2511
\LMHash{}%
2505
2512
Optional formal parameters may be specified and provided with default values.
@@ -2511,7 +2518,7 @@ \subsubsection{Optional and Named Formals}
2511
2518
2512
2519
<defaultNamedParameter> ::= \gnewline{}
2513
2520
<metadata> \REQUIRED? <normalFormalParameterNoMetadata>
2514
- \gnewline{} (`: ' <expression>)?
2521
+ \gnewline{} (`= ' <expression>)?
2515
2522
\end{grammar}
2516
2523
2517
2524
\LMHash{}%
@@ -2529,7 +2536,7 @@ \subsubsection{Optional and Named Formals}
2529
2536
\Error{compile-time error} if a required named parameter has a default value.
2530
2537
2531
2538
\LMHash{}%
2532
- Assume that $p$ is an optional named parameter with default value $d$.
2539
+ Assume that $p$ is an optional parameter with default value $d$.
2533
2540
It is a \Error{compile-time error}
2534
2541
if the static type of $d$ is not assignable to the declared type of $p$.
2535
2542
0 commit comments