|
116 | 116 | /// collection wrapper instead of a set. To restore efficient set operations,
|
117 | 117 | /// create a new set from the result.
|
118 | 118 | ///
|
119 |
| -/// let morePrimes = primes.union([11, 13, 17, 19]) |
120 |
| -/// |
121 |
| -/// let laterPrimes = morePrimes.filter { $0 > 10 } |
122 |
| -/// // 'laterPrimes' is of type Array<Int> |
123 |
| -/// |
124 |
| -/// let laterPrimesSet = Set(morePrimes.filter { $0 > 10 }) |
125 |
| -/// // 'laterPrimesSet' is of type Set<Int> |
| 119 | +/// let primesStrings = primes.map(String.init) |
| 120 | +/// // 'primesStrings' is of type Array<String> |
| 121 | +/// let primesStringsSet = Set(primes.map(String.init)) |
| 122 | +/// // 'primesStringsSet' is of type Set<String> |
126 | 123 | ///
|
127 | 124 | /// Bridging Between Set and NSSet
|
128 | 125 | /// ==============================
|
@@ -522,14 +519,14 @@ extension Set: SetAlgebra {
|
522 | 519 | ///
|
523 | 520 | /// var classDays: Set<DayOfTheWeek> = [.wednesday, .friday]
|
524 | 521 | /// print(classDays.insert(.monday))
|
525 |
| - /// // Prints "(true, .monday)" |
| 522 | + /// // Prints "(inserted: true, memberAfterInsert: DayOfTheWeek.monday)" |
526 | 523 | /// print(classDays)
|
527 |
| - /// // Prints "[.friday, .wednesday, .monday]" |
| 524 | + /// // Prints "[DayOfTheWeek.friday, DayOfTheWeek.wednesday, DayOfTheWeek.monday]" |
528 | 525 | ///
|
529 | 526 | /// print(classDays.insert(.friday))
|
530 |
| - /// // Prints "(false, .friday)" |
| 527 | + /// // Prints "(inserted: false, memberAfterInsert: DayOfTheWeek.friday)" |
531 | 528 | /// print(classDays)
|
532 |
| - /// // Prints "[.friday, .wednesday, .monday]" |
| 529 | + /// // Prints "[DayOfTheWeek.friday, DayOfTheWeek.wednesday, DayOfTheWeek.monday]" |
533 | 530 | ///
|
534 | 531 | /// - Parameter newMember: An element to insert into the set.
|
535 | 532 | /// - Returns: `(true, newMember)` if `newMember` was not contained in the
|
@@ -559,7 +556,7 @@ extension Set: SetAlgebra {
|
559 | 556 | ///
|
560 | 557 | /// var classDays: Set<DayOfTheWeek> = [.monday, .wednesday, .friday]
|
561 | 558 | /// print(classDays.update(with: .monday))
|
562 |
| - /// // Prints "Optional(.monday)" |
| 559 | + /// // Prints "Optional(DayOfTheWeek.monday)" |
563 | 560 | ///
|
564 | 561 | /// - Parameter newMember: An element to insert into the set.
|
565 | 562 | /// - Returns: An element equal to `newMember` if the set already contained
|
|
0 commit comments