> On 12. Oct 2017, at 01:17, Kelvin Ma via swift-evolution > <[email protected]> wrote: > > On Wed, Oct 11, 2017 at 6:06 PM, Nevin Brackett-Rozinsky > <[email protected] <mailto:[email protected]>> > wrote: > On Wednesday, October 11, 2017, Kelvin Ma via swift-evolution > <[email protected] <mailto:[email protected]>> 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/>
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
