[swift-evolution] [SHORT Review] SE-0132: Rationalizing Sequence end-operation names
daniel at duan.org
Tue Jul 26 02:01:13 CDT 2016
> On Jul 25, 2016, at 11:32 PM, David Hart via swift-evolution <swift-evolution at swift.org> wrote:
> On 26 Jul 2016, at 06:50, Xiaodi Wu via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>> surface area and leverages the user's understanding of how ranges
>> It also implies we can replace
>> for Collections.
>> I'm not enamored of this suggestion. It succeeds in reducing API surface area, but at a severe cost to readability. You'd replace an unambiguous phrase (removing prefix or suffix), the meaning of which is further clarified by the consistent usage proposed in SE-0132, with a wordless spelling using some combination of [$+.<]. Cognitively, also, it substantially increases the burden for the reader: it replaces a single argument with a nested series of arguments; first, one must understand the meaning of the $ placeholder, then one must consider an addition or subtraction operation, then the formation of a range, and in the last example, the use of that range as a subscript argument--again, all wordlessly. Finally, subscripts have so far not been "forgiving," while today's `dropLast` very much is; this suggestion would add inconsistency by using a subscript for a forgiving or "lenient" operation.
> I second Xiaodi. I am against the slicing subscripts and the ones above look even more unreadable and inscrutable than those in the proposal. I don't understand the rational.
The inspiration is D: https://dlang.org/d-array-article.html <https://dlang.org/d-array-article.html>
> swift-evolution mailing list
> swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution