Skip to content

Commit

Permalink
Add spaces before and after closure arrow in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ken0nek committed Dec 22, 2015
1 parent a03824e commit 50c88b9
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/Generics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ OrderedCollection>) are just sugar for a where clause. For example, the
above find() signature is equivalent to::

func find<C where C : OrderedCollection, C.Element : Comparable>(
collection : C, value : C.Element)-> Int
collection : C, value : C.Element) -> Int

Note that find<C> is shorthand for (and equivalent to) find<C : Any>, since
every type conforms to the Any protocol composition.
Expand Down
2 changes: 1 addition & 1 deletion docs/StdlibAPIGuidelines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ Acceptable Short or Non-Descriptive Names

func map<U>(transformation: T->U) -> [U] // not this one

func forEach<S: SequenceType>(body: (S.Generator.Element)->())
func forEach<S: SequenceType>(body: (S.Generator.Element) -> ())

Prefixes and Suffixes
---------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/StringDesign.rst
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ Searching

:Swift:
.. parsed-literal::
func **find**\ (match: (Character)->Bool) -> Range<String.IndexType>
func **find**\ (match: (Character) -> Bool) -> Range<String.IndexType>
.. Admonition:: Usage Example

Expand Down Expand Up @@ -1100,7 +1100,7 @@ Capitalization
:Swift:
.. parsed-literal::
trim **trim**\ (match: (Character)->Bool) -> String
trim **trim**\ (match: (Character) -> Bool) -> String
.. Admonition:: Usage Example

Expand Down
4 changes: 2 additions & 2 deletions docs/archive/LangRefNew.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1537,8 +1537,8 @@ Short Circuiting Logical Operators

::

func && (lhs: Bool, rhs: ()->Bool) -> Bool
func || (lhs: Bool, rhs: ()->Bool) -> Bool
func && (lhs: Bool, rhs: () -> Bool) -> Bool
func || (lhs: Bool, rhs: () -> Bool) -> Bool

Swift has a simplified precedence levels when compared with C. From highest to
lowest:
Expand Down
2 changes: 1 addition & 1 deletion docs/proposals/InoutCOWOptimization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ could be written as follows:
protocol Sliceable {
...
@mutating
func quickSort(compare: (StreamType.Element, StreamType.Element)->Bool) {
func quickSort(compare: (StreamType.Element, StreamType.Element) -> Bool) {
let (start,end) = (startIndex, endIndex)
if start != end && start.succ() != end {
let pivot = self[start]
Expand Down
4 changes: 2 additions & 2 deletions docs/proposals/Inplace.rst
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ as though it were written:
.. parsed-literal::
{
(var y: X)->X in
(var y: X) -> X in
y\ **.=**\ *f*\ (a₀, p₁: a₁, p₂: a₂, …p\ *n*: a\ *n*)
return y
}(x)
Expand Down Expand Up @@ -344,7 +344,7 @@ as though it were written:
.. parsed-literal::
{
(var y: X)->X in
(var y: X) -> X in
y *op*\ **=**\ *expression*
return y
}(x)
Expand Down
8 changes: 4 additions & 4 deletions docs/proposals/ValueSemantics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ Here’s a version of cycle_length that works when state is a mutable
value type::

func cycle_length<State>(
s : State, mutate : ( [inout] State )->()
s : State, mutate : ( [inout] State ) -> ()
) -> Int
requires State : EqualityComparable
{
Expand Down Expand Up @@ -211,7 +211,7 @@ classes:
}
func cycle_length<State>(
s : State, mutate : ( [inout] State )->()
s : State, mutate : ( [inout] State ) -> ()
) -> Int
requires State : EqualityComparable, **Clonable**
{
Expand All @@ -233,8 +233,8 @@ clonable classes:
func cycle_length<State>(
s : State,
**next : (x : State)->State,**
**equal : ([inout] x : State, [inout] y : State)->Bool**
**next : (x : State) -> State,**
**equal : ([inout] x : State, [inout] y : State) -> Bool**
) -> Int
requires State : EqualityComparable
{
Expand Down
4 changes: 2 additions & 2 deletions docs/proposals/valref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Array elements can be explicitly declared ``val`` or ``ref``::
When a reference to an array appears without a variable name, it can
be written using the `usual syntax`__::

var f : ()->ref Int[42] // a closure returning a reference to an array
var f : () -> ref Int[42] // a closure returning a reference to an array
var b : ref Int[42] // equivalent to "ref b : Int[42]"

__ `standalone types`_
Expand All @@ -191,7 +191,7 @@ brackets, that most users will never touch, e.g.::
var z : Array<ref Int,42> // an array of 42 integers-on-the-heap
var z : Array<ref Array<Int,42>, 2> // an array of 2 references to arrays
ref a : Array<Int,42> // a reference to an array of 42 integers
var f : ()->ref Array<Int,42> // a closure returning a reference to an array
var f : () -> ref Array<Int,42> // a closure returning a reference to an array
var b : ref Array<Int,42> // equivalent to "ref b : Int[42]"

Rules for copying array elements follow those of instance variables.
Expand Down

0 comments on commit 50c88b9

Please sign in to comment.