Skip to content

Commit 132cad9

Browse files
Bolpatntrel
authored andcommitted
Apply suggestions from code review
Co-authored-by: Nick Treleaven <[email protected]>
1 parent a4ff66e commit 132cad9

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

spec/statement.dd

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ $(GNAME OpApplyParameter):
745745
Above, `opApply` is matched both when `i` is and is not `ref`, so by using
746746
a `ref` delegate parameter, both forms are supported.
747747

748-
Stating the type of the variable like in the first loop is optional,
748+
Stating the type of the variable (as in the first loop) is optional,
749749
as is showcased in the second loop, where the type is inferred.
750750
)
751751

@@ -770,10 +770,10 @@ $(GNAME OpApplyParameter):
770770

771771
$(P The $(D opApply) and $(D opApplyReverse) member functions can be overloaded.
772772
Selection works similar to overload resolution by
773-
comparing the number of `foreach` variables and number of parameters of `body` and,
774-
if more than one overload remains unique overload,
775-
matching the parameter types of `body` and each $(I ForeachType)
776-
declared in the $(I ForeachStatement) when given.)
773+
comparing the number of `foreach` variables with the number of parameters of `body` and,
774+
if more than one overload remains,
775+
matching each parameter of `body` against each $(I ForeachType)
776+
declared in the $(I ForeachStatement).)
777777

778778
$(BEST_PRACTICE Overload apply functions only with delegates differing in number of parameters
779779
to enable type inference for `foreach` variables.
@@ -828,20 +828,20 @@ $(CONSOLE
828828

829829
$(PANEL
830830
The `scope` storage class on the `body` parameter means that the delegate does
831-
not escape the scope of the apply function (an example would be assigning`body` to a
831+
not escape the scope of the apply function (e.g. assigning `body` to a
832832
global variable). If it cannot be statically guaranteed that `body` does not escape, a closure may
833833
be allocated for it on the heap instead of the stack.
834834
)
835835

836-
$(P $(B Important:) If apply functions catch any exceptions, ensure that those
836+
$(P $(B Important:) If an apply function catches any exceptions, ensure that those
837837
exceptions did not originate from the delegate. The user would expect
838838
exceptions thrown from a `foreach` body to both terminate the loop, and propagate outside
839839
the `foreach` body.
840840
)
841841

842842
$(H4 $(LNAME2 template-op-apply, Template `opApply`))
843843

844-
$(P `opApply` and `opApplyReverse` can also be a function templates,
844+
$(P `opApply` and `opApplyReverse` can also be function templates,
845845
which can optionally infer the types of parameters based on the $(I ForeachStatement).
846846
)
847847

0 commit comments

Comments
 (0)