Updated proposal with https://github.com/apple/swift-evolution/pull/226

I went with option #2 as recommended.


> On Mar 23, 2016, at 10:27 AM, Douglas Gregor <[email protected]> wrote:
> 
> 
>> On Mar 22, 2016, at 9:30 PM, Brent Royal-Gordon <[email protected] 
>> <mailto:[email protected]>> wrote:
>> 
>>> float Point3DGetPointAtIndex(int idx, Point3D point)
>>> __attribute__((swift_name("getter:subscript(_:self:)")))
>>> void Point3DSetPointAtIndex(int idx, Point3D point, float val)
>>> __attribute__((swift_name("getter:subscript(_:self:newValue:)")))
>> 
>> I think this is the best option. Subscripts can have multiple parameters, 
>> including parameter labels, so you need the full range of expressiveness, 
>> including `_`, to correctly represent them. `newValue`'s name is technically 
>> changeable, but it almost never actually *is* changed, and everyone will 
>> understand what it refers to.
> 
> 
> Right. And at worse we’ve eliminated the ability to express
> 
> subscript (newValue newValue: Int) -> Int { … }
> 
> I can live with that limitation.
> 
>       - Doug
> 

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to