File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -1484,9 +1484,9 @@ The `for`-`in` loop above iterates over an array of tuples,
14841484binding the first and second elements of the tuples
14851485to the ` x ` and ` y ` constants.
14861486The statements inside the loop can use those constants,
1487- like the ` if ` statement that checks whether the point lies on the x-axis.
1487+ such as the ` if ` statement that checks whether the point lies on the x-axis.
14881488A more concise way to write this code
1489- is to combine the value bindings and condition,
1489+ is to combine the value bindings and condition
14901490using a ` for ` -` case ` -` in ` loop.
14911491The code below has the same behavior as the ` for ` -` in ` loop above:
14921492
@@ -2074,8 +2074,6 @@ without wrapping it in an `else` block,
20742074and it lets you keep the code that handles a violated requirement
20752075next to the requirement.
20762076
2077- <!-- XXX show guard-case syntax for completeness? -->
2078-
20792077## Deferred Actions
20802078
20812079Unlike control-flow constructs like ` if ` and ` while ` ,
Original file line number Diff line number Diff line change @@ -495,7 +495,7 @@ if case .qrCode(let productCode) = productBarcode {
495495Just like in the switch statement earlier,
496496the ` productBarcode ` variable is matched against
497497the pattern ` .qrCode(let productCode) ` here.
498- And like in the switch case,
498+ And as in the switch case,
499499writing ` let ` extracts the associated value as a constant.
500500For more information about ` if ` -` case ` statements,
501501see < doc:ControlFlow#Patterns > .
@@ -546,7 +546,7 @@ to give an enumeration an additional value,
546546it's important to understand the difference between them.
547547You pick the raw value for an enumeration case
548548when you define that enumeration case in your code,
549- like the three ASCII codes above.
549+ such as the three ASCII codes above.
550550The raw value for a particular enumeration case is always the same.
551551In contrast,
552552you pick associated values when you create a new constant or variable
You can’t perform that action at this time.
0 commit comments