[swift-evolution] [Pitch] Named subscripts 2

Tony Freeman tonyfreeman at protonmail.com
Fri Jan 13 03:43:50 CST 2017


Hello Swift community,


I found this very useful while wrapping c api, although this may simplify the code in other cases when subscript doesn't have it's own state and(or) share some state form the container.

here is an example: https://gist.github.com/tonyfreeman/949ce0a9aa374ab6fa2fc7de0dccaa27

another option would be use set/get functions, but it doesn't feel right.


Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170113/adc781d8/attachment.html>


More information about the swift-evolution mailing list