[swift-evolution] [Review] SE-0023 API Design Guidelines (when to use properties)

Brent Royal-Gordon brent at architechies.com
Sun Jan 31 21:37:13 CST 2016

> There has to be an
> underlying assumption that an Array's count must be a property, or
> something else of that sort, in the background.

You know, this would be a language change, but it occurs to me that, if a property could satisfy a protocol requirement for a parameterless method with no overloads, you *could* have an O(1) rule for properties. `Collection` would require a count() method, and `Array` would have a `count` property, and that would satisfy the requirement.

Brent Royal-Gordon

More information about the swift-evolution mailing list