[swift-evolution] [SHORT Review] SE-0132: Rationalizing Sequence end-operation names

Nevin Brackett-Rozinsky nevin.brackettrozinsky at gmail.com
Tue Jul 26 19:29:39 CDT 2016


On Tue, Jul 26, 2016 at 7:56 PM, Boris Wang via swift-evolution <
swift-evolution at swift.org> wrote:

> We should consider SE-0111.
> The label of parameter is not part of function signature anymore.
>

What are you driving at?

Per SE–0111
<https://github.com/apple/swift-evolution/blob/master/proposals/0111-remove-arg-label-type-significance.md>,
a function’s argument labels are no longer part of the function’s *type*,
whereas per SE–0021
<https://github.com/apple/swift-evolution/blob/master/proposals/0021-generalized-naming.md>
they *are* part of its *name*. The whole discussion in this thread has been
about *naming*, so I don’t see the relevance of bringing up SE–0111.



> Just a quick peek, what's your first impression for
>
> some.first(n)
>
> Opt 1: the first element, who's value == n
> Opt 2: the elements, who's index less than n
>

Neither.

It is asking for, quite specifically, the first n elements.

Nevin



>
> Ben Rimmington via swift-evolution <swift-evolution at swift.org>于2016年7月27日
> 周三07:29写道:
>
>>
>> > On 26 Jul 2016, at 16:15, Dave Abrahams wrote:
>> >
>> >>> b. they are given a recognizable domain-specific notation such as:
>> >>>
>> >>>  x.removeSubrange($+n..<)
>> >>>  x.removeSubrange(..<$-n)
>> >>
>> >> Does $ represent the start, the end, or either one depending on which
>> >> side of the range we're on? Because if it's the third option, I think
>> >> these two operations are actually inverted: the first is removing
>> >> everything *except* the `prefix(n)`, and the second is removing
>> >> everything except the `suffix(n)`.
>> >
>> > Wow, that was impressive!  With one stroke, you have just convinced me
>> > that we can't do this.  The fact that I got it wrong, along with other
>> > excellent feedback in this thread, kills my interest in using $ in this
>> > way.
>>
>> This would also conflict with one of the following:
>>
>> 1. Allowing `$` for the Dollar library.
>>
>>         <https://github.com/apple/swift-evolution/pull/354>
>>
>> 2. Reserving `$` for the debugger.
>>
>>         <https://github.com/apple/swift/pull/3004>
>>
>> (The latter "test and merge" is failing for some reason).
>>
>> -- Ben
>>
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-evolution
>>
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160726/7efe3bf5/attachment.html>


More information about the swift-evolution mailing list