[swift-evolution] SE-1084 (B): buffer pointer partial initialization API
Nevin Brackett-Rozinsky
nevin.brackettrozinsky at gmail.com
Wed Oct 11 18:06:25 CDT 2017
On Wednesday, October 11, 2017, Kelvin Ma via swift-evolution <
swift-evolution at swift.org> wrote:
> Yes, a 0-ary operator like that would have to be hard baked into the
> language itself.
>
Actually, you can just make a subscript which takes a function as an
argument, and call it by passing in the ellipsis operator.
Nevin
Of course, the subscript notation has much more serious problems, there is
> no way to allow one-sided subscripting, but disallow two-sided subscripting
> for the memory API, while still allowing two-sided subscripting for
> ordinary slicing operations. This is why I still think at:from: is the
> much better syntax.
>
> On Wed, Oct 11, 2017 at 3:01 PM, Nevin Brackett-Rozinsky <
> nevin.brackettrozinsky at gmail.com
> <javascript:_e(%7B%7D,'cvml','nevin.brackettrozinsky at gmail.com');>> wrote:
>
>> I believe Kelvin was asking about the usage of ellipsis *by itself*, as
>> in Xiaodi’s example, “newBuffer[...]”.
>>
>> Nevin
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20171011/35f6849a/attachment.html>
More information about the swift-evolution
mailing list