Moving this thread to the correct mailing list.

Am 8. August 2017 um 06:36:18, Félix Cloutier via swift-evolution 
( schrieb:

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, 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 “joined” does 
not create new storage. Then wouldn’t it have to refer to the source objects by 
reference? How; especially how does it work without requiring a “&” with 
“inout” or how it works with “let”-mode objects? Or am I misunderstanding how 
it works behind the covers?

(If there is a secret sauce to have one object refer to another without 
“&”/“inout”/“UnsafeWhateverPointer”, I like to know. It may help with 
implementing an idea. The idea involves extending the language, so “compiler 
magic” that the user can’t access is OK; I’d just claim to use the same sauce 
in my proposal.)

Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com 

swift-evolution mailing list

swift-evolution mailing list
swift-users mailing list

Reply via email to