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

Michael Ilseman milseman at apple.com
Wed Mar 23 16:46:25 CDT 2016


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 <dgregor at apple.com> wrote:
> 
> 
>> On Mar 22, 2016, at 9:30 PM, Brent Royal-Gordon <brent at architechies.com <mailto:brent at architechies.com>> 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
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160323/2a697d5a/attachment.html>


More information about the swift-evolution mailing list