3 ms·
Swift semantics can be unduly confusing and complicated. "copy on write" value semantics mean you can have two variable references to the same memory for a lon
by w10-1 4y ago
Swift semantics can be unduly confusing and complicated.
"copy on write" value semantics mean you can have two variable references to the same memory for a long time before one mutation causes the space to be copied and mutated, leaving the other unaffected.
The function name "move" here is beyond terrible. It makes sense only to compiler writers, and even then it is ambiguous.
The function's goal/effect is to end the lifetime of a variable binding, to essentially force the COW.
(So much for scoping.)
More generally, Swift grows in fits and starts mostly driven by Apple internal needs. So if Apple needs `move(x)`, you might, too.
Poor Swift team: fully exposed in open-source, but driven and locked to Apple's needs. All the best to them.
- pjmlp 4y agoThey can have some beers with Microsoft, Oracle, Google, IBM language teams.
- stephencanon 4y ago> The function name "move" here is beyond terrible. It makes sense only to compiler writers, and even then it is ambiguous. These are exactly the sorts of issues that an evolution proposal is supposed to shake out. It gives users a chance to weigh in on new features, including naming, before they land in the language or standard library. The name is very much not finalized yet, and comments pointing toward a better binding for the functionality would be welcome.