Skip to content

Commit e0e5257

Browse files
committed
Merge pull request #128 from jandrewstre/patch-2
Fix a few typos and grammar in docs/Pattern Matching.rst
2 parents ac4f146 + 43ef46d commit e0e5257

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

docs/Pattern Matching.rst

+9-9
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ Swift has a pretty small set of types right now:
2424
* Fundamental types: currently i1, i8, i16, i32, and i64;
2525
float and double; eventually maybe others.
2626
* Function types.
27-
* Tuples. Heterogenous fixed-length products. Swift's system
27+
* Tuples. Heterogeneous fixed-length products. Swift's system
2828
provides two basic kinds of element: positional and labelled.
2929
* Arrays. Homogenous fixed-length aggregates.
3030
* Algebraic data types (ADTs), introduce by enum. Nominal closed
31-
disjoint unions of heterogenous types.
32-
* Struct types. Nominal heterogenous fixed-length products.
33-
* Class types. Nominal, subtypeable heterogenous fixed-length products
31+
disjoint unions of heterogeneous types.
32+
* Struct types. Nominal heterogeneous fixed-length products.
33+
* Class types. Nominal, subtypeable heterogeneous fixed-length products
3434
with identity.
3535
* Protocol and protocol-composition types.
3636

@@ -171,7 +171,7 @@ Default
171171
.......
172172

173173
I keep going back and forth about having a "default" case-introducer.
174-
On the one hand, I kindof want to encourage total matches. On the
174+
On the one hand, I kind of want to encourage total matches. On the
175175
other hand, (1) having it is consistent with C, (2) it's not an
176176
unnatural style, and (3) there are cases where exhaustive switching
177177
isn't going to be possible. We can certainly recommend complete
@@ -274,7 +274,7 @@ fallthrough".
274274

275275
Chris seems motivated to eventually add an explicit 'fallthrough'
276276
statement. If we did this, my preference would be to generalize it by
277-
allowing the match to be reperformed with a new value, e.g.
277+
allowing the match to be performed again with a new value, e.g.
278278
:code:`fallthrough(something)`, at least optionally. I think having
279279
local functions removes a lot of the impetus, but not so much as to
280280
render the feature worthless.
@@ -419,7 +419,7 @@ Assignment
419419
..........
420420

421421
This is a bit iffy. It's a lot like var bindings, but it doesn't have a keyword,
422-
so it's really kindof ambiguous given the pattern grammar.
422+
so it's really kind of ambiguous given the pattern grammar.
423423

424424
Also, l-value patterns are weird. I can come up with semantics for this, but I
425425
don't know what the neighbors will think::
@@ -511,7 +511,7 @@ equal to this expression, but allow some holes and some more complex
511511
'matcher' values". But it's possible that it instead might be really
512512
badly confusing. We'll see! It'll be fun!
513513

514-
This kindof forces us to have parallel pattern grammars for the two
514+
This kind of forces us to have parallel pattern grammars for the two
515515
major clients:
516516

517517
- Match patterns are used in :code:`switch` and :code:`matches`, where
@@ -574,7 +574,7 @@ Annotation patterns
574574

575575
In an exhaustive pattern, you can annotate an arbitrary sub-pattern
576576
with a type. This is useful in an exhaustive pattern: the type of a
577-
variable isn't always inferrable (or correctly inferrable), and types
577+
variable isn't always inferable (or correctly inferable), and types
578578
in function signatures are generally outright required. It's not as
579579
useful in a match pattern, and the colon can be grammatically awkward
580580
there, so we disallow it.

0 commit comments

Comments
 (0)