Re: [swift-evolution] How does "Sequence.joined" work?

2017-08-09 Thread Daryle Walker via swift-evolution
> On Aug 9, 2017, at 12:19 PM, Taylor Swift wrote: > > On Wed, Aug 9, 2017 at 10:43 AM, Daryle Walker via swift-evolution > mailto:swift-evolution@swift.org>> wrote: > >> On Aug 8, 2017, at 6:45 PM, Geordie Jay > > wrote: >> >> Daryle Walker via swift-evolution >

Re: [swift-evolution] How does "Sequence.joined" work?

2017-08-09 Thread Taylor Swift via swift-evolution
On Wed, Aug 9, 2017 at 10:43 AM, Daryle Walker via swift-evolution < swift-evolution@swift.org> wrote: > > On Aug 8, 2017, at 6:45 PM, Geordie Jay wrote: > > > Daryle Walker via swift-evolution schrieb am > Di. 8. Aug. 2017 um 21:25: > >> On Aug 8, 2017, at 12:35 AM, Félix Cloutier >> wrote: >>

Re: [swift-evolution] How does "Sequence.joined" work?

2017-08-09 Thread Daryle Walker via swift-evolution
> On Aug 8, 2017, at 6:45 PM, Geordie Jay wrote: > > > Daryle Walker via swift-evolution > schrieb am Di. 8. Aug. 2017 um 21:25: >> On Aug 8, 2017, at 12:35 AM, Félix Cloutier > > wrote: >> >> All this means is that `joined()`

Re: [swift-evolution] How does "Sequence.joined" work?

2017-08-08 Thread Taylor Swift via swift-evolution
On Wed, Aug 9, 2017 at 12:29 AM, Félix Cloutier via swift-evolution < swift-evolution@swift.org> wrote: > Yes, exactly. An Array is a struct wrapper for a reference type > representing storage. Mutating functions first check if they own the only > reference to the storage using isKnownUniquelyRefe

Re: [swift-evolution] How does "Sequence.joined" work?

2017-08-08 Thread Félix Cloutier via swift-evolution
Yes, exactly. An Array is a struct wrapper for a reference type representing storage. Mutating functions first check if they own the only reference to the storage using isKnownUniquelyReferenced . If not, they ma

Re: [swift-evolution] How does "Sequence.joined" work?

2017-08-08 Thread Geordie Jay via swift-evolution
Daryle Walker via swift-evolution schrieb am Di. 8. Aug. 2017 um 21:25: > On Aug 8, 2017, at 12:35 AM, Félix Cloutier > wrote: > > All this means is that `joined()` does not create an array that contains > the new result. It's only as magic as the COW semantics on arrays. > > > So you’re saying

Re: [swift-evolution] How does "Sequence.joined" work?

2017-08-08 Thread John McCall via swift-evolution
> On Aug 8, 2017, at 3:24 PM, Daryle Walker via swift-evolution > wrote: >> On Aug 8, 2017, at 12:35 AM, Félix Cloutier > > wrote: >> >> All this means is that `joined()` does not create an array that contains the >> new result. It's only as magic as the COW sem

Re: [swift-evolution] How does "Sequence.joined" work?

2017-08-08 Thread Daryle Walker via swift-evolution
> On Aug 8, 2017, at 12:35 AM, Félix Cloutier wrote: > > All this means is that `joined()` does not create an array that contains the > new result. It's only as magic as the COW semantics on arrays. So you’re saying the COW semantics for Array and other standard library types have secret refer

Re: [swift-evolution] How does "Sequence.joined" work?

2017-08-07 Thread Félix Cloutier via swift-evolution
All this means is that `joined()` does not create an array that contains the new result. It's only as magic as the COW semantics on arrays. > Le 7 août 2017 à 21:12, Daryle Walker via swift-evolution > a écrit : > > I was looking at random items at SwiftDoc.org , and > n

[swift-evolution] How does "Sequence.joined" work?

2017-08-07 Thread Daryle Walker via swift-evolution
I was looking at random items at SwiftDoc.org , and noticed the “FlattenBidirectionalCollection” structure. It helps implement some versions of “joined” from Sequence (probably when the Sequence is also a BidirectionalCollection). The directions for the type state that “joi