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