[swift-evolution] SE-1084 (B): buffer pointer partial initialization API

Ole Begemann ole at oleb.net
Thu Oct 12 03:36:08 CDT 2017


> On 12. Oct 2017, at 01:17, Kelvin Ma via swift-evolution <swift-evolution at swift.org> wrote:
> 
> On Wed, Oct 11, 2017 at 6:06 PM, Nevin Brackett-Rozinsky <nevin.brackettrozinsky at gmail.com <mailto:nevin.brackettrozinsky at gmail.com>> wrote:
> On Wednesday, October 11, 2017, Kelvin Ma via swift-evolution <swift-evolution at swift.org <mailto: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.
> 
> I mean,,, you can,,, but that’s kind of weird

That's exactly how the [...] notation is implemented in the stdlib. Toni Suter wrote a great article about it: https://tonisuter.com/blog/2017/08/unbounded-ranges-swift-4/ <https://tonisuter.com/blog/2017/08/unbounded-ranges-swift-4/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20171012/eb36752d/attachment.html>


More information about the swift-evolution mailing list