Skip to content

Commit 3918d9d

Browse files
[gardening] Replace likely word processor artefacts with ASCII equivalents (— → --, … → ...)
1 parent 74d03b9 commit 3918d9d

31 files changed

+128
-128
lines changed

CHANGELOG.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,8 @@ using the `.dynamicType` member to retrieve the type of an expression should mig
327327
```swift
328328
let a: Foo & Bar
329329
let b = value as? A & B & C
330-
func foo<T : Foo & Bar>(x: T) { }
331-
func bar(x: Foo & Bar) { }
330+
func foo<T : Foo & Bar>(x: T) { ... }
331+
func bar(x: Foo & Bar) { ... }
332332
typealias G = GenericStruct<Foo & Bar>
333333
```
334334

@@ -1106,7 +1106,7 @@ Swift 2.0
11061106
* Public extensions of generic types are now permitted.
11071107

11081108
```swift
1109-
public extension Array { }
1109+
public extension Array { ... }
11101110
```
11111111

11121112
**(16974298)**
@@ -1266,8 +1266,8 @@ Swift 2.0
12661266
For example:
12671267

12681268
```swift
1269-
func produceGizmoUsingTechnology() throws -> Gizmo { }
1270-
func produceGizmoUsingMagic() throws -> Gizmo { }
1269+
func produceGizmoUsingTechnology() throws -> Gizmo { ... }
1270+
func produceGizmoUsingMagic() throws -> Gizmo { ... }
12711271

12721272
if let result = try? produceGizmoUsingTechnology() { return result }
12731273
if let result = try? produceGizmoUsingMagic() { return result }
@@ -1440,7 +1440,7 @@ Swift 2.0
14401440
function or initializer. For example:
14411441

14421442
```swift
1443-
func doSomethingToValues(values: Int... , options: MyOptions = [], fn: (Int) -&gt; Void) { }
1443+
func doSomethingToValues(values: Int... , options: MyOptions = [], fn: (Int) -&gt; Void) { ... }
14441444
```
14451445

14461446
**(20127197)**
@@ -1472,7 +1472,7 @@ Swift 2.0
14721472
**(17227475)**
14731473

14741474
* When delegating or chaining to a failable initializer (for example, with
1475-
`self.init()` or `super.init()`), one can now force-unwrap the result with
1475+
`self.init(...)` or `super.init(...)`), one can now force-unwrap the result with
14761476
`!`. For example:
14771477

14781478
```swift
@@ -2179,7 +2179,7 @@ Swift 1.2
21792179
}
21802180

21812181
class MySomethingDelegate : SomethingDelegate {
2182-
@objc func didSomething() { }
2182+
@objc func didSomething() { ... }
21832183
}
21842184
```
21852185

benchmark/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,11 @@ To add a new multiple file test:
156156
1. Add a new directory and files under the `multi-source` directory as
157157
specified below:
158158

159-
├── multi-source
160-
   ├── YourTestName
161-
      ├── TestFile1.swift
162-
      ├── TestFile2.swift
163-
      ├── TestFile3.swift
159+
+-- multi-source
160+
|   +-- YourTestName
161+
|   |   +-- TestFile1.swift
162+
|   |   +-- TestFile2.swift
163+
|   |   +-- TestFile3.swift
164164

165165
At least one run function (specified in the template below) must
166166
exist in the files.

docs/AccessControl.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ future, ``public`` may be used for both API and SPI, at which point we may
2121
design additional annotations to distinguish the two.
2222

2323
By default, most entities in a source file have ``internal`` access.
24-
This optimizes for the most common casea single-target application
25-
projectwhile not accidentally revealing entities to clients of a framework
24+
This optimizes for the most common case--a single-target application
25+
project--while not accidentally revealing entities to clients of a framework
2626
module.
2727

2828
.. warning:: This document has not yet been updated for SE-0117, which adds the

docs/AccessControlInStdlib.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ To document the reason for marking symbols public, we use comments:
5454
`internal`
5555
==========
5656

57-
In Swift, `internal` is an implied default everywhereexcept within
57+
In Swift, `internal` is an implied default everywhere--except within
5858
`public` extensions and protocols. Therefore, `internal` should be used
5959
explicitly everywhere in the stdlib to avoid confusion.
6060

docs/Arrays.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ Swift provides three generic array types, all of which have amortized
5353
O(1) growth. In this document, statements about **ArrayType** apply
5454
to all three of the components.
5555

56-
* ``ContiguousArray<Element>`` is the fastest and simplest of the threeuse
56+
* ``ContiguousArray<Element>`` is the fastest and simplest of the three--use
5757
this when you need "C array" performance. The elements of a
5858
``ContiguousArray`` are always stored contiguously in memory.
5959

6060
.. image:: ContiguousArray.png
6161

6262
* ``Array<Element>`` is like ``ContiguousArray<Element>``, but optimized for
63-
efficient conversions from Cocoa and backwhen ``Element`` can be a class
63+
efficient conversions from Cocoa and back--when ``Element`` can be a class
6464
type, ``Array<Element>`` can be backed by the (potentially non-contiguous)
6565
storage of an arbitrary ``NSArray`` rather than by a Swift
6666
``ContiguousArray``. ``Array<Element>`` also supports up- and downcasts
@@ -227,7 +227,7 @@ TODO: this section is outdated.
227227

228228
When up-casting an ``[Derived]`` to ``[Base]``, a buffer of
229229
``Derived`` object can simply be ``unsafeBitCast``\ 'ed to a buffer
230-
of elements of type ``Base``as long as the resulting buffer is never
230+
of elements of type ``Base``--as long as the resulting buffer is never
231231
mutated. For example, we cannot allow a ``Base`` element to be
232232
inserted in the buffer, because the buffer's destructor will destroy
233233
the elements with the (incorrect) static presumption that they have

docs/GenericsManifesto.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ func apply<... Args, Result>(fn: (Args...) -> Result, // function taking some
369369

370370
### Extensions of structural types
371371

372-
Currently, only nominal types (classes, structs, enums, protocols) can be extended. One could imagine extending structural typesparticularly tuple typesto allow them to, e.g., conform to protocols. For example, pulling together variadic generics, parameterized extensions, and conditional conformances, one could express "a tuple type is `Equatable` if all of its element types are `Equatable`":
372+
Currently, only nominal types (classes, structs, enums, protocols) can be extended. One could imagine extending structural types--particularly tuple types--to allow them to, e.g., conform to protocols. For example, pulling together variadic generics, parameterized extensions, and conditional conformances, one could express "a tuple type is `Equatable` if all of its element types are `Equatable`":
373373

374374
```Swift
375375
extension<...Elements : Equatable> (Elements...) : Equatable { // extending the tuple type "(Elements...)" to be Equatable
@@ -450,7 +450,7 @@ The `where` clause of generic functions comes very early in the declaration, alt
450450
func containsAll<S: Sequence where Sequence.Iterator.Element == Element>(elements: S) -> Bool
451451
```
452452

453-
One could move the `where` clause to the end of the signature, so that the most important partsname, generic parameter, parameters, result typeprecede it:
453+
One could move the `where` clause to the end of the signature, so that the most important parts--name, generic parameter, parameters, result type--precede it:
454454

455455
```Swift
456456
func containsAll<S: Sequence>(elements: S) -> Bool
@@ -636,7 +636,7 @@ func foo(value: Any) {
636636
foo(X())
637637
```
638638

639-
Under what circumstances should it print "P"? If `foo()` is defined within the same module as the conformance of `X` to `P`? If the call is defined within the same module as the conformance of `X` to `P`? Never? Either of the first two answers requires significant complications in the dynamic casting infrastructure to take into account the module in which a particular dynamic cast occurred (the first option) or where an existential was formed (the second option), while the third answer breaks the link between the static and dynamic type systemsnone of which is an acceptable result.
639+
Under what circumstances should it print "P"? If `foo()` is defined within the same module as the conformance of `X` to `P`? If the call is defined within the same module as the conformance of `X` to `P`? Never? Either of the first two answers requires significant complications in the dynamic casting infrastructure to take into account the module in which a particular dynamic cast occurred (the first option) or where an existential was formed (the second option), while the third answer breaks the link between the static and dynamic type systems--none of which is an acceptable result.
640640

641641
### Conditional conformances via protocol extensions
642642

docs/GitWorkflows.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ Purpose
1111
Swift development has been based on SVN since its inception. As part of the
1212
transition to Git this document helps to address questions about how common SVN
1313
workflows we use today translate to their Git counterparts as well as to discuss
14-
Git workflow practices we plan on having at least initially after the Git
15-
transition. Notably we will follow a model where commits to trunk which is
16-
the 'master' branch in Git has commits land (in the common case) via rebasing
14+
Git workflow practices we plan on having -- at least initially -- after the Git
15+
transition. Notably we will follow a model where commits to trunk -- which is
16+
the 'master' branch in Git -- has commits land (in the common case) via rebasing
1717
instead of merging. This model is open to evolution later, but this mimics the
1818
workflow we have today with SVN.
1919

docs/InitializerProblems.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Problem 3: Factory Initializers
6060
===============================
6161

6262
Finally, we try to standardize on initializers for object creation in Swift,
63-
even going as far as to import Objective-C factory methods as initializersbut
63+
even going as far as to import Objective-C factory methods as initializers...but
6464
there are some patterns that cannot be written in Swift, such as this one::
6565

6666
class AnyGenerator<Element> : GeneratorType {

docs/LibraryEvolution.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ specifying the name of the client library along with the required version::
128128

129129
// Client code
130130
@available(Magician 1.5)
131-
class CrystalBallView : MagicView { /**/ }
131+
class CrystalBallView : MagicView { /*...*/ }
132132

133133
Library versions can also be checked dynamically using ``#available``, allowing
134134
for fallback behavior when the requested library version is not present::
@@ -393,7 +393,7 @@ example using methods::
393393

394394
public struct Point2D {
395395
var x, y: Double
396-
public init(x: Double, y: Double) { /**/ }
396+
public init(x: Double, y: Double) { /*...*/ }
397397
}
398398

399399
extension Point2D {
@@ -410,7 +410,7 @@ polar representation::
410410

411411
public struct Point2D {
412412
var r, theta: Double
413-
public init(x: Double, y: Double) { /**/ }
413+
public init(x: Double, y: Double) { /*...*/ }
414414
}
415415

416416
and the ``x`` and ``y`` properties have now disappeared. To avoid this, the
@@ -659,13 +659,13 @@ can enforce its safe use.
659659
We've considered two possible syntaxes for this::
660660

661661
@available(1.1)
662-
extension Wand : MagicType {/**/}
662+
extension Wand : MagicType {/*...*/}
663663

664664
and
665665

666666
::
667667

668-
extension Wand : @available(1.1) MagicType {/**/}
668+
extension Wand : @available(1.1) MagicType {/*...*/}
669669

670670
The former requires fewer changes to the language grammar, but the latter could
671671
also be used on the declaration of the type itself (i.e. the ``struct``

docs/MutationModel.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ The implicit ``self`` parameter of a struct or enum method is semantically an
106106
objects.
107107

108108
A program that applies the ``mutating`` to a method of a
109-
classor of a protocol attributed with ``@class_protocol``is
109+
class--or of a protocol attributed with ``@class_protocol``--is
110110
ill-formed. [Note: it is logically consistent to think of all methods
111111
of classes as read-only, even though they may in fact modify instance
112112
variables, because they never "write back" onto the source reference.]

docs/PatternMatching.rst

+10-10
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ Scoping
269269

270270
Despite the lack of grouping braces, the semantics are that the statements in
271271
each case-group form their own scope, and falling off the end causes control to
272-
resume at the end of the switch statement i.e. "implicit break", not "implicit
272+
resume at the end of the switch statement -- i.e. "implicit break", not "implicit
273273
fallthrough".
274274

275275
Chris seems motivated to eventually add an explicit 'fallthrough'
@@ -285,27 +285,27 @@ grouped by braces. It's natural to group the cases with braces as well. Doing
285285
both lets us avoid a 'case' keyword, but otherwise it leads to ugly style,
286286
because either the last case ends in two braces on the same line or cases have
287287
to further indented. Okay, it's easy enough to not require braces on the match,
288-
with the grammar saying that cases are just greedily consumed there's no
288+
with the grammar saying that cases are just greedily consumed -- there's no
289289
ambiguity here because the switch statement is necessarily within braces. But
290290
that leaves the code without a definitive end to the cases, and the closing
291291
braces end up causing a lot of unnecessary vertical whitespace, like so::
292292

293293
switch (x)
294294
case .foo {
295-
//
295+
// ...
296296
}
297297
case .bar {
298-
//
298+
// ...
299299
}
300300

301301
So instead, let's require the switch statement to have braces, and
302302
we'll allow the cases to be written without them::
303303

304304
switch (x) {
305305
case .foo:
306-
//
306+
// ...
307307
case .bar:
308-
//
308+
// ...
309309
}
310310

311311
That's really a lot prettier, except it breaks the rule about always grouping
@@ -350,8 +350,8 @@ Non-exhaustive switches
350350
.......................
351351

352352
Since falling out of a statement is reasonable behavior in an
353-
imperative language in contrast to, say, a functional language where
354-
you're in an expression and you need to produce a value there's a
353+
imperative language -- in contrast to, say, a functional language where
354+
you're in an expression and you need to produce a value -- there's a
355355
colorable argument that non-exhaustive matches should be okay. I
356356
dislike this, however, and propose that it should be an error to
357357
make a non-exhaustive switch; people who want non-exhaustive matches
@@ -527,7 +527,7 @@ major clients:
527527
You might think that having a "pattern" as basic as :code:`foo` mean
528528
something different in two different contexts would be confusing, but
529529
actually I don't think people will generally think of these as the
530-
same production you might if you were in a functional language where
530+
same production -- you might if you were in a functional language where
531531
you really can decompose in a function signature, but we don't allow
532532
that, and I think that will serve to divide them in programmers' minds.
533533
So we can get away with some things. :)
@@ -800,7 +800,7 @@ It would be interesting to allow overloading / customization of
800800
pattern-matching. We may find ourselves needing to do something like this to
801801
support non-fragile pattern matching anyway (if there's some set of restrictions
802802
that make it reasonable to permit that). The obvious idea of compiling into the
803-
visitor pattern is a bit compelling, although control flow would be tricky
803+
visitor pattern is a bit compelling, although control flow would be tricky --
804804
we'd probably need the generated code to throw an exception. Alternatively, we
805805
could let the non-fragile type convert itself into a fragile type for purposes
806806
of pattern matching.

docs/SequencesAndCollections.rst

+10-10
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ taxonomy exists and how it is structured.
1414
Sequences
1515
=========
1616

17-
It all begins with Swift's `for`\ \ `in` loop::
17+
It all begins with Swift's `for`\ ...\ `in` loop::
1818

1919
for x in s {
2020
doSomethingWith(x)
@@ -42,8 +42,8 @@ represented by the `SequenceType` protocol::
4242

4343
.. sidebar:: Hiding Iterator Type Details
4444

45-
A sequence's iterator is an associated typerather than something
46-
like |AnyIterator|__ that depends only on the element typefor
45+
A sequence's iterator is an associated type--rather than something
46+
like |AnyIterator|__ that depends only on the element type--for
4747
performance reasons. Although the alternative design has
4848
significant usability benefits, it requires one dynamic
4949
allocation/deallocation pair and *N* dynamic dispatches to traverse
@@ -65,7 +65,7 @@ the two kinds of sequences.
6565
are traversed.
6666

6767
* **Stable** sequences, like arrays, should *not* be mutated by `for`\
68-
\ `in`, and thus require *separate traversal state*.
68+
...\ `in`, and thus require *separate traversal state*.
6969

7070
To get an initial traversal state for an arbitrary sequence `x`, Swift
7171
calls `x.makeIterator()`. The sequence delivers that state, along with
@@ -74,7 +74,7 @@ traversal logic, in the form of an **iterator**.
7474
Iterators
7575
==========
7676

77-
`for`\ \ `in` needs three operations from the iterator:
77+
`for`\ ...\ `in` needs three operations from the iterator:
7878

7979
* get the current element
8080
* advance to the next element
@@ -114,7 +114,7 @@ returning `nil` when the iterator is exhausted::
114114
}
115115

116116
Combined with `SequenceType`, we now have everything we need to
117-
implement a generic `for`\ \ `in` loop.
117+
implement a generic `for`\ ...\ `in` loop.
118118

119119
.. sidebar:: Adding a Buffer
120120

@@ -149,7 +149,7 @@ implement a generic `for`\ …\ `in` loop.
149149
Operating on Sequences Generically
150150
----------------------------------
151151

152-
Given an arbitrary `SequenceType`, aside from a simple `for`\ \ `in` loop,
152+
Given an arbitrary `SequenceType`, aside from a simple `for`\ ...\ `in` loop,
153153
you can do anything that requires reading elements from beginning to
154154
end. For example::
155155

@@ -174,7 +174,7 @@ end. For example::
174174
let s = String(array("Swift", withSeparator: "|"))
175175
print(s) // "S|w|i|f|t"
176176

177-
Because sequences may be volatile, though, you canin generalonly
177+
Because sequences may be volatile, though, you can--in general--only
178178
make a single traversal. This capability is quite enough for many
179179
languages: the iteration abstractions of Java, C#, Python, and Ruby
180180
all go about as far as `SequenceType`, and no further. In Swift,
@@ -230,7 +230,7 @@ how we interact with arrays: we subscript the collection using its
230230

231231
let ith = c[i]
232232

233-
An **index**\ which must model `ForwardIndexType`\ is a type with a
233+
An **index**\ --which must model `ForwardIndexType`\ --is a type with a
234234
linear series of discrete values that can be compared for equality:
235235

236236
.. sidebar:: Dictionary Keys
@@ -365,7 +365,7 @@ All direct operations on indices are intended to be lightweight, with
365365
amortized O(1) complexity. In fact, indices into `Dictionary` and
366366
`Set` *could* be bidirectional, but are limited to modeling
367367
`ForwardIndexType` because the APIs of `NSDictionary` and
368-
`NSSet`which can act as backing stores of `Dictionary` and `Set`do
368+
`NSSet`--which can act as backing stores of `Dictionary` and `Set`--do
369369
not efficiently support reverse traversal.
370370

371371
Conclusion

0 commit comments

Comments
 (0)