> On Jul 10, 2016, at 5:18 PM, James Froggatt via swift-evolution > <[email protected]> wrote: > > Currently, the signature is: > subscript(_ example: Int) -> Element { > get { … } > set { … } > } > > The alternative, using a colon, would be: > subscript(_ example: Int) : Element { > get { … } > set { … } > } > > Sorry if that wasn't clear. > > This would be to better reflect the property-like nature of access.
It all depends on whether a subscript is more function-y or property-y, and don't forget subscripts can take parameters and labels. let y = myArrayOfStrings[safeIndex: 2, fallback: "foo"] -- E _______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
