@@ -218,7 +218,7 @@ we mean a specific instance of a semantic, user-language value.
218218
219219For example, consider the following Swift code:
220220
221- ```
221+ ``` swift
222222var x = [1 ,2 ,3 ]
223223var y = x
224224```
@@ -418,7 +418,7 @@ discussed in the introduction. For example, suppose that
418418the callee loads a value from its argument, then calls
419419a function which the optimizer cannot reason about:
420420
421- ```
421+ ``` swift
422422extension Array {
423423 mutating func organize (_ predicate : (Element ) -> Bool ) {
424424 let first = self [0 ]
@@ -916,7 +916,7 @@ semantically necessary when working with non-copyable types.
916916
917917We propose to remove this limitation in a straightforward way:
918918
919- ```
919+ ``` swift
920920inout root = & tree.root
921921
922922shared elements = self .queue
@@ -946,7 +946,7 @@ cases to be spelled explicitly:
946946
947947- A function argument can be explicitly declared ` owned ` :
948948
949- ```
949+ ``` swift
950950 func append (_ values : owned [Element ]) {
951951 ...
952952 }
@@ -960,7 +960,7 @@ cases to be spelled explicitly:
960960
961961- A function argument can be explicitly declared ` shared ` .
962962
963- ```
963+ ``` swift
964964 func == (left : shared String , right : shared String ) -> Bool {
965965 ...
966966 }
@@ -994,7 +994,7 @@ cases to be spelled explicitly:
994994
995995- A method can be explicitly declared ` consuming ` .
996996
997- ```
997+ ``` swift
998998 consuming func moveElements (into collection : inout [Element ]) {
999999 ...
10001000 }
@@ -1060,7 +1060,7 @@ sequence cannot be iterated multiple times, this is a
10601060This can be explicitly requested by declaring the iteration
10611061variable ` owned ` :
10621062
1063- ```
1063+ ``` swift
10641064for owned employee in company.employees {
10651065 newCompany.employees .append (employee)
10661066}
@@ -1083,7 +1083,7 @@ operation on `Collection`.
10831083This can be explicitly requested by declaring the iteration
10841084variable ` shared ` :
10851085
1086- ```
1086+ ``` swift
10871087for shared employee in company.employees {
10881088 if ! employee.respected { throw CatastrophicHRFailure () }
10891089}
@@ -1093,7 +1093,7 @@ It is also used by default when the sequence type is known to
10931093conform to ` Collection ` , since this is the optimal way of
10941094iterating over a collection.
10951095
1096- ```
1096+ ``` swift
10971097for employee in company.employees {
10981098 if ! employee.respected { throw CatastrophicHRFailure () }
10991099}
@@ -1117,7 +1117,7 @@ operation on `MutableCollection`.
11171117This must be explicitly requested by declaring the
11181118iteration variable ` inout ` :
11191119
1120- ```
1120+ ``` swift
11211121for inout employee in company.employees {
11221122 employee.respected = true
11231123}
@@ -1145,7 +1145,7 @@ languages to conveniently implement iteration. In Swift,
11451145to follow this pattern, we would need to allow the definition
11461146of generator functions, e.g.:
11471147
1148- ```
1148+ ``` swift
11491149mutating generator iterateMutable () -> inout Element {
11501150 var i = startIndex, e = endIndex
11511151 while i != e {
@@ -1193,7 +1193,7 @@ to invoke one because these would only be used in accessors.
11931193The idea is that, instead of defining ` get ` and ` set ` ,
11941194a storage declaration could define ` read ` and ` modify ` :
11951195
1196- ```
1196+ ``` swift
11971197var x: String
11981198var y: String
11991199var first: String {
@@ -1231,7 +1231,7 @@ For this reason, we propose the `move` function. Conceptually,
12311231` move ` is simply a top-level function in the Swift standard
12321232library:
12331233
1234- ```
1234+ ``` swift
12351235func move <T >(_ value : T) -> T {
12361236 return value
12371237}
@@ -1270,7 +1270,7 @@ variables are initialized before use.
12701270
12711271` copy ` is a top-level function in the Swift standard library:
12721272
1273- ```
1273+ ``` swift
12741274func copy <T >(_ value : T) -> T {
12751275 return value
12761276}
@@ -1294,7 +1294,7 @@ value is returned. This is useful for several reasons:
12941294
12951295` endScope ` is a top-level function in the Swift standard library:
12961296
1297- ```
1297+ ``` swift
12981298func endScope <T >(_ value : T) -> () {}
12991299```
13001300
@@ -1326,7 +1326,7 @@ every component is statically resolvable to a storage declaration.
13261326There is some recurring interest in the community in allowing programs
13271327to abstract over storage, so that you might say:
13281328
1329- ```
1329+ ``` swift
13301330let prop = Widget.weight
13311331```
13321332
@@ -1408,7 +1408,7 @@ a `moveonly` context are also implicitly `moveonly`.
14081408
14091409A type can be a ` moveonly ` context:
14101410
1411- ```
1411+ ``` swift
14121412moveonly struct Array <Element > {
14131413 // Element and Array<Element> are not assumed to be copyable here
14141414}
@@ -1420,7 +1420,7 @@ hierarchies of associated types.
14201420
14211421An extension can be a ` moveonly ` context:
14221422
1423- ```
1423+ ``` swift
14241424moveonly extension Array {
14251425 // Element and Array<Element> are not assumed to be copyable here
14261426}
@@ -1429,7 +1429,7 @@ moveonly extension Array {
14291429A type can declare conditional copyability using a conditional
14301430conformance:
14311431
1432- ```
1432+ ``` swift
14331433moveonly extension Array : Copyable where Element : Copyable {
14341434 ...
14351435}
@@ -1450,7 +1450,7 @@ it a non-`moveonly` extension is an error.
14501450
14511451A function can be a ` moveonly ` context:
14521452
1453- ```
1453+ ``` swift
14541454extension Array {
14551455 moveonly func report <U >(_ u : U)
14561456}
@@ -1483,7 +1483,7 @@ used to express the unique ownership of resources. For
14831483example, here is a simple file-handle type that ensures
14841484that the handle is closed when the value is destroyed:
14851485
1486- ```
1486+ ``` swift
14871487moveonly struct File {
14881488 var descriptor: Int32
14891489
0 commit comments