[swift-evolution] [swift-evolution-announce] [Review] SE-0044 Import as Member

Brent Royal-Gordon brent at architechies.com
Tue Mar 22 23:30:34 CDT 2016


> 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.

-- 
Brent Royal-Gordon
Architechies



More information about the swift-evolution mailing list