Skip to content

Commit a8dd1de

Browse files
committed
Merge pull request #896 from practicalswift/curly-quotes
[gardening] Consistently use normal quotes ("…") instead of curly quotes (“…”)
2 parents 1c5ffe6 + 6c8c9bf commit a8dd1de

17 files changed

+88
-88
lines changed

docs/AccessControlInStdlib.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Scope and introduction
66
This document defines the policy for applying access control modifiers and
77
related naming conventions for the Swift standard library and overlays.
88

9-
In this document, stdlib refers to the core standard library and
9+
In this document, "stdlib" refers to the core standard library and
1010
overlays for system frameworks written in Swift.
1111

1212
Swift has three levels of access control --- private, internal
@@ -60,7 +60,7 @@ explicitly everywhere in the stdlib to avoid confusion.
6060

6161
.. Note:: No declaration should omit an access
6262

63-
To create a single point of truth about whether a name is intended
63+
To create a "single point of truth" about whether a name is intended
6464
for user consumption, the following names should all use the `leading
6565
underscore rule`_:
6666

docs/MutationModel.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Consider::
3737
}
3838

3939
var w = Window()
40-
w.title += " (parenthesized remark)
40+
w.title += " (parenthesized remark)"
4141

4242
What do we do with this? Since ``+=`` has an ``inout`` first
4343
argument, we detect this situation statically (hopefully one day we’ll
@@ -101,14 +101,14 @@ Otherwise, it is considered **read-only**.
101101
102102
The implicit ``self`` parameter of a struct or enum method is semantically an
103103
``inout`` parameter if and only if the method is attributed with
104-
``mutating``. Read-only methods do not write back onto their target
104+
``mutating``. Read-only methods do not "write back" onto their target
105105
objects.
106106

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

113113
Mutating Operations
114114
-------------------

docs/OptimizerDesign.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ phase (stands for intermediate representation generation phase) that lowers SIL
2525
into LLVM IR. The LLVM backend optimizes and emits binary code for the compiled
2626
program.
2727

28-
Please refer to the document Swift Intermediate Language (SIL) for more
28+
Please refer to the document "Swift Intermediate Language (SIL)" for more
2929
details about the SIL IR.
3030

3131
The compiler optimizer is responsible for optimizing the program using the
@@ -125,8 +125,8 @@ The mechanism that swift uses to invalidate analysis is broadcast-invalidation.
125125
Passes ask the pass manager to invalidate specific traits. For example, a pass
126126
like simplify-cfg will ask the pass manager to announce that it modified some
127127
branches in the code. The pass manager will send a message to all of the
128-
available analysis that says please invalidate yourself if you care about
129-
branches for function F. The dominator tree would then invalidate the dominator
128+
available analysis that says "please invalidate yourself if you care about
129+
branches for function F". The dominator tree would then invalidate the dominator
130130
tree for function F because it knows that changes to branches can mean that the
131131
dominator tree was modified.
132132

@@ -189,7 +189,7 @@ functions with the @_semantics attribute until after all of the data-structure
189189
specific optimizations are done. Unfortunately, this lengthens our optimization
190190
pipeline.
191191

192-
Please refer to the document High-Level SIL Optimizations for more details.
192+
Please refer to the document "High-Level SIL Optimizations" for more details.
193193

194194

195195
### Instruction Invalidation in SIL
@@ -241,4 +241,4 @@ TODO.
241241

242242
### List of passes
243243

244-
The updated list of passes is available in the file Passes.def.
244+
The updated list of passes is available in the file "Passes.def".

docs/SIL.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ generic constraints:
576576
* Non-class protocol types
577577
* @weak types
578578

579-
Values of address-only type (address-only values) must reside in
579+
Values of address-only type ("address-only values") must reside in
580580
memory and can only be referenced in SIL by address. Addresses of
581581
address-only values cannot be loaded from or stored to. SIL provides
582582
special instructions for indirectly manipulating address-only

docs/SequencesAndCollections.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ As you can see, sequence does nothing more than deliver a generator.
6060
To understand the need for generators, it's important to distinguish
6161
the two kinds of sequences.
6262

63-
* **Volatile** sequences like stream of network packets, carry
64-
their own traversal state, and are expected to be consumed as they
63+
* **Volatile** sequences like "stream of network packets," carry
64+
their own traversal state, and are expected to be "consumed" as they
6565
are traversed.
6666

6767
* **Stable** sequences, like arrays, should *not* be mutated by `for`\
@@ -215,7 +215,7 @@ that stability in generic code, we'll need another protocol.
215215
Collections
216216
===========
217217

218-
A **collection** is a stable sequence with addressable positions,
218+
A **collection** is a stable sequence with addressable "positions,"
219219
represented by an associated `Index` type::
220220
221221
protocol CollectionType : SequenceType {

docs/StdlibAPIGuidelines.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Subsequent Parameters
102102
Other Differences
103103
-----------------
104104

105-
* We don't use namespace prefixes such as `NS`, relying instead on
105+
* We don't use namespace prefixes such as "`NS`", relying instead on
106106
the language's own facilities.
107107

108108
* Names of types, protocols and enum cases are `UpperCamelCase`.
@@ -156,7 +156,7 @@ library, but are compatible with the Cocoa guidelines.
156156
}
157157

158158
* Even unlabelled parameter names should be meaningful as they'll be
159-
referred to in comments and visible in generated headers
159+
referred to in comments and visible in "generated headers"
160160
(cmd-click in Xcode):
161161

162162
.. parsed-literal::
@@ -205,7 +205,7 @@ Acceptable Short or Non-Descriptive Names
205205
Prefixes and Suffixes
206206
---------------------
207207

208-
* `Any` is used as a prefix to denote type erasure,
208+
* `Any` is used as a prefix to denote "type erasure,"
209209
e.g. `AnySequence<T>` wraps any sequence with element type `T`,
210210
conforms to `SequenceType` itself, and forwards all operations to the
211211
wrapped sequence. When handling the wrapper, the specific type of

docs/StdlibRationales.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ generally *should* use a keyword. For example, ``String(33, radix:
6464
they're converting. Secondly, avoiding method or property syntax
6565
provides a distinct context for code completion. Rather than
6666
appearing in completions offered after ``.``, for example, the
67-
available conversions could show up whenever the user hit the tab
67+
available conversions could show up whenever the user hit the "tab"
6868
key after an expression.
6969

7070
Protocols with restricted conformance rules

docs/StringDesign.rst

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ Goals
116116
``String`` should:
117117

118118
* honor industry standards such as Unicode
119-
* when handling non-ASCII text, deliver reasonably correct
119+
* when handling non-ASCII text, deliver "reasonably correct"
120120
results to users thinking only in terms of ASCII
121-
* when handling ASCII text, provide expected behavior to users
121+
* when handling ASCII text, provide "expected behavior" to users
122122
thinking only in terms of ASCII
123123
* be hard to use incorrectly
124124
* be easy to use correctly
@@ -165,7 +165,7 @@ optimizations, including:
165165
- In-place modification of uniquely-owned buffers
166166

167167
As a result, copying_ and slicing__ strings, in particular, can be
168-
viewed by most programmers as being almost free.
168+
viewed by most programmers as being "almost free."
169169

170170
__ sliceable_
171171

@@ -197,7 +197,7 @@ Strings are **Value Types**
197197
Distinct string variables have independent values: when you pass
198198
someone a string they get a copy of the value, and when someone
199199
passes you a string *you own it*. Nobody can change a string value
200-
behind your back.
200+
"behind your back."
201201

202202
.. parsed-literal::
203203
|swift| class Cave {
@@ -231,18 +231,18 @@ Strings are **Unicode-Aware**
231231
specifies requires careful justification. So far, we have found two
232232
possible points of deviation for Swift ``String``:
233233

234-
1. The `Unicode Text Segmentation Specification`_ says, `do not
235-
break between CR and LF`__. However, breaking extended
234+
1. The `Unicode Text Segmentation Specification`_ says, "`do not
235+
break between CR and LF`__." However, breaking extended
236236
grapheme clusters between CR and LF may necessary if we wish
237-
``String`` to behave normally for users of pure ASCII. This
237+
``String`` to "behave normally" for users of pure ASCII. This
238238
point is still open for discussion.
239239

240240
__ http://www.unicode.org/reports/tr29/#GB2
241241

242242
2. The `Unicode Text Segmentation Specification`_ says,
243-
`do not break between regional indicator symbols`__. However, it also
244-
says (Sequences of more than two RI characters should be separated
245-
by other characters, such as U+200B ZWSP). Although the
243+
"`do not break between regional indicator symbols`__." However, it also
244+
says "(Sequences of more than two RI characters should be separated
245+
by other characters, such as U+200B ZWSP)." Although the
246246
parenthesized note probably has less official weight than the other
247247
admonition, breaking pairs of RI characters seems like the right
248248
thing for us to do given that Cocoa already forms strings with
@@ -278,7 +278,7 @@ Strings are **Locale-Agnostic**
278278

279279
Strings neither carry their own locale information, nor provide
280280
behaviors that depend on a global locale setting. Thus, for any pair
281-
of strings ``s1`` and ``s2``, ``s1 == s2`` yields the same result
281+
of strings ``s1`` and ``s2``, "``s1 == s2``" yields the same result
282282
regardless of system state. Strings *do* provide a suitable
283283
foundation on which to build locale-aware interfaces.\ [#locales]_
284284

@@ -316,8 +316,8 @@ Strings are Composed of ``Character``\ s
316316
cluster**, as specified by a default or tailored Unicode segmentation
317317
algorithm. This term is `precisely defined`__ by the Unicode
318318
specification, but it roughly means `what the user thinks of when she
319-
hears character`__. For example, the pair of code points LATIN
320-
SMALL LETTER N, COMBINING TILDE forms a single grapheme cluster, “ñ”.
319+
hears "character"`__. For example, the pair of code points "LATIN
320+
SMALL LETTER N, COMBINING TILDE" forms a single grapheme cluster, "ñ".
321321

322322
__ http://www.unicode.org/glossary/#grapheme_cluster
323323
__ http://useless-factor.blogspot.com/2007/08/unicode-implementers-guide-part-4.html
@@ -342,8 +342,8 @@ __ http://www.unicode.org/glossary/#extended_grapheme_cluster
342342
__ http://www.unicode.org/reports/tr29/#Default_Grapheme_Cluster_Table
343343

344344
This segmentation offers naïve users of English, Chinese, French, and
345-
probably a few other languages what we think of as the expected
346-
results. However, not every script_ can be segmented uniformly for
345+
probably a few other languages what we think of as the "expected
346+
results." However, not every script_ can be segmented uniformly for
347347
all purposes. For example, searching and collation require different
348348
segmentations in order to handle Indic scripts correctly. To that
349349
end, strings support properties for more-specific segmentations:
@@ -386,9 +386,9 @@ Strings are **Sliceable**
386386
.. parsed-literal::
387387
|swift| s[r.start...r.end]
388388
`// r2 : String = "awe"`
389-
|swift| s[\ :look1:`r.start...`\ ]\ :aside:`postfix slice operator means through the end`
389+
|swift| s[\ :look1:`r.start...`\ ]\ :aside:`postfix slice operator means "through the end"`
390390
`// r3 : String = "awesome"`
391-
|swift| s[\ :look1:`...r.start`\ ]\ :aside:`prefix slice operator means from the beginning`
391+
|swift| s[\ :look1:`...r.start`\ ]\ :aside:`prefix slice operator means "from the beginning"`
392392
`// r4 : String = "Strings are "`
393393
|swift| :look1:`s[r]`\ :aside:`indexing with a range is the same as slicing`
394394
`// r5 : String = "awe"`
@@ -579,7 +579,7 @@ How Would You Design It?
579579
5. CodePoint substring search is just byte string search
580580
6. Most programs that handle 8-bit files safely can handle UTF-8 safely
581581
7. UTF-8 sequences sort in code point order.
582-
8. UTF-8 has no byte order.
582+
8. UTF-8 has no "byte order."
583583

584584
__ http://research.swtch.com/2010/03/utf-8-bits-bytes-and-benefits.html
585585

@@ -682,7 +682,7 @@ withRange:subrange]`` becomes ``str[subrange].doFoo(arg)``.
682682

683683
* Deprecated Cocoa APIs are not considered
684684

685-
* A status of *Remove* below indicates a feature whose removal is
685+
* A status of "*Remove*" below indicates a feature whose removal is
686686
anticipated. Rationale is provided for these cases.
687687

688688
Indexing
@@ -806,18 +806,18 @@ Comparison
806806
func **<=** (lhs: String, rhs: String) -> Bool
807807
func **>=** (lhs: String, rhs: String) -> Bool
808808
809-
``NSString`` comparison is literal by default. As the documentation
809+
``NSString`` comparison is "literal" by default. As the documentation
810810
says of ``isEqualToString``,
811811

812-
“Ö” represented as the composed character sequence “O” and umlaut
813-
would not compare equal to “Ö” represented as one Unicode character.
812+
"Ö" represented as the composed character sequence "O" and umlaut
813+
would not compare equal to "Ö" represented as one Unicode character.
814814

815815
By contrast, Swift string's primary comparison interface uses
816816
Unicode's default collation_ algorithm, and is thus always
817-
Unicode-correct. Unlike comparisons that depend on locale, it is
817+
"Unicode-correct." Unlike comparisons that depend on locale, it is
818818
also stable across changes in system state. However, *just like*
819819
``NSString``\ 's ``isEqualToString`` and ``compare`` methods, it
820-
should not be expected to yield ideal (or even proper) results in
820+
should not be expected to yield ideal (or even "proper") results in
821821
all contexts.
822822

823823
---------
@@ -1084,10 +1084,10 @@ Capitalization
10841084

10851085
.. Note:: ``NSString`` capitalizes the first letter of each substring
10861086
separated by spaces, tabs, or line terminators, which is in
1087-
no sense Unicode-correct. In most other languages that
1087+
no sense "Unicode-correct." In most other languages that
10881088
support a ``capitalize`` method, it operates only on the
10891089
first character of the string, and capitalization-by-word is
1090-
named something like ``title``. If Swift ``String``
1090+
named something like "``title``." If Swift ``String``
10911091
supports capitalization by word, it should be
10921092
Unicode-correct, but how we sort this particular area out is
10931093
still **TBD**.
@@ -1712,7 +1712,7 @@ Why YAGNI
17121712
* Derivation
17131713
* ...
17141714

1715-
.. [#agnostic] Unicode specifies default (un-tailored)
1715+
.. [#agnostic] Unicode specifies default ("un-tailored")
17161716
locale-independent collation_ and segmentation_ algorithms that
17171717
make reasonable sense in most contexts. Using these algorithms
17181718
allows strings to be naturally compared and combined, generating
@@ -1748,6 +1748,6 @@ Why YAGNI
17481748
been normalized, thus speeding up comparison operations.
17491749
17501750
.. [#elements] Since ``String`` is locale-agnostic_, its elements are
1751-
determined using Unicode's default, un-tailored segmentation_
1751+
determined using Unicode's default, "un-tailored" segmentation_
17521752
algorithm.
17531753

docs/TextFormatting.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Scope
2121
Goals
2222
.....
2323

24-
* The REPL and LLDB (debuggers) share formatting logic
25-
* All types are debug-printable automatically
26-
* Making a type printable for humans is super-easy
24+
* The REPL and LLDB ("debuggers") share formatting logic
25+
* All types are "debug-printable" automatically
26+
* Making a type "printable for humans" is super-easy
2727
* ``toString()``-ability is a consequence of printability.
2828
* Customizing a type's printed representations is super-easy
2929
* Format variations such as numeric radix are explicit and readable
@@ -43,11 +43,11 @@ Non-Goals
4343
that feature. Therefore, localization and dynamic format strings
4444
should be designed together, and *under this proposal* the only
4545
format strings are string literals containing interpolations
46-
(``\(...)``). Cocoa programmers can still use Cocoa localization
46+
("``\(...)``"). Cocoa programmers can still use Cocoa localization
4747
APIs for localization jobs.
4848

4949
In Swift, only the most common cases need to be very terse.
50-
Anything fancy can afford to be a bit more verbose. If and when
50+
Anything "fancy" can afford to be a bit more verbose. If and when
5151
we address localization and design a full-featured dynamic string
5252
formatter, it may make sense to incorporate features of ``printf``
5353
into the design.
@@ -68,7 +68,7 @@ printed with ``print(x)``, and can be converted to ``String`` with
6868

6969
The simple extension story for beginners is as follows:
7070

71-
To make your type ``CustomStringConvertible``, simply declare conformance to
71+
"To make your type ``CustomStringConvertible``, simply declare conformance to
7272
``CustomStringConvertible``::
7373

7474
extension Person : CustomStringConvertible {}
@@ -152,9 +152,9 @@ directly to the ``OutputStream`` for efficiency reasons,
152152
Producing a representation that can be consumed by the REPL
153153
and LLDB to produce an equivalent object is strongly encouraged
154154
where possible! For example, ``String.debugFormat()`` produces
155-
a representation starting and ending with ``"``, where special
155+
a representation starting and ending with "``"``", where special
156156
characters are escaped, etc. A ``struct Point { var x, y: Int }``
157-
might be represented as ``Point(x: 3, y: 5)``.
157+
might be represented as "``Point(x: 3, y: 5)``".
158158

159159
(Non-Debug) Printing
160160
....................
@@ -348,7 +348,7 @@ an underlying stream::
348348

349349
However, upcasing is a trivial example: many such transformations—such
350350
as ``trim()`` or regex replacement—are stateful, which implies some
351-
way of indicating end of input so that buffered state can be
351+
way of indicating "end of input" so that buffered state can be
352352
processed and written to the underlying stream:
353353

354354
.. parsed-literal::
@@ -422,10 +422,10 @@ If we were willing to say that only ``class``\ es can conform to
422422
``OutputStream``\ s are passed around. Then, we'd simply need a
423423
``class StringStream`` for creating ``String`` representations. It
424424
would also make ``OutputStream`` adapters a *bit* simpler to use
425-
because you'd never need to write back explicitly onto the target
425+
because you'd never need to "write back" explicitly onto the target
426426
stream. However, stateful ``OutputStream`` adapters would still need a
427427
``close()`` method, which makes a perfect place to return a copy of
428-
the underlying stream, which can then be written back:
428+
the underlying stream, which can then be "written back":
429429

430430
.. parsed-literal::
431431

0 commit comments

Comments
 (0)