Skip to content

Commit d34032d

Browse files
amartini51Chuck Toporek
andcommitted
Incorporate edits from Chuck
Co-authored-by: Chuck Toporek <[email protected]>
1 parent da17c1b commit d34032d

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

TSPL.docc/LanguageGuide/Protocols.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ the underlying type of that source.
823823

824824
The example below defines a dice game
825825
and a nested protocol for a delegate
826-
that tracks the game's progress.
826+
that tracks the game's progress:
827827

828828
```swift
829829
class DiceGame {
@@ -866,7 +866,7 @@ class DiceGame {
866866
The `DiceGame` class implements a game where
867867
each player takes a turn rolling dice,
868868
and the player who rolls the highest number wins the round.
869-
It uses a linear congruential generator,
869+
It uses a linear congruential generator
870870
from the example earlier in the chapter,
871871
to generate random numbers for dice rolls.
872872

@@ -901,7 +901,7 @@ Because the `delegate` property is an *optional* `DiceGame.Delegate`,
901901
the `play(rounds:)` method uses optional chaining each time it calls a method on the delegate,
902902
as discussed in <doc:OptionalChaining>.
903903
If the `delegate` property is nil,
904-
these delegate calls are just skipped.
904+
these delegate calls are ignored.
905905
If the `delegate` property is non-nil,
906906
the delegate methods are called,
907907
and are passed the `DiceGame` instance as a parameter.
@@ -926,7 +926,7 @@ class DiceGameTracker: DiceGame.Delegate {
926926
case 2: playerScore2 += 1
927927
print("Player 2 won round \(round)")
928928
default:
929-
print("Round was a draw")
929+
print("The round was a draw")
930930
}
931931
}
932932
func gameDidEnd(_ game: DiceGame) {

TSPL.docc/ReferenceManual/Declarations.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2273,8 +2273,7 @@ as discussed in <doc:Declarations#Extension-Declaration>.
22732273
## Protocol Declaration
22742274

22752275
A *protocol declaration* introduces a named protocol type into your program.
2276-
Protocol declarations are declared either at global scope
2277-
or nested inside a nongeneric type or nongeneric function,
2276+
Protocol declarations are declared
22782277
using the `protocol` keyword and have the following form:
22792278

22802279
```swift
@@ -2283,6 +2282,9 @@ protocol <#protocol name#>: <#inherited protocols#> {
22832282
}
22842283
```
22852284

2285+
Protocol declarations can appear at global scope,
2286+
or nested inside a nongeneric type or nongeneric function.
2287+
22862288
The body of a protocol contains zero or more *protocol member declarations*,
22872289
which describe the conformance requirements that any type adopting the protocol must fulfill.
22882290
In particular, a protocol can declare that conforming types must

0 commit comments

Comments
 (0)