[swift-users] Design guidelines for computed property vs no-arg method

Jens Persson jens at bitcycle.com
Wed Jul 5 20:33:52 CDT 2017


On Wed, Jul 5, 2017 at 11:50 PM, Dave Abrahams via swift-users <
swift-users at swift.org> wrote:

>> As a name, signum falls into the “term-of-art” category, so at least
> that part is in conformance to the guidelines.  In specialized areas
> like this one, I generally defer to the domain experts, and IIRC our
> numerics people thought a function was more appropriate.  In general,
> though, we were unable to come up with solid guidelines for the use of
> properties vs. functions.  You can read more about this in the thread
> that starts here:
> https://lists.swift.org/pipermail/swift-evolution/
> Week-of-Mon-20160125/007927.html
>
>
Thanks, I'll read that thread.
I am however noting that FloatingPoint.sign is a computed property.
Seems to me like the "term-of-art" category is a rather fussy and
complicated/complicating concept.
/Jens
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20170706/4d3d6f33/attachment.html>


More information about the swift-users mailing list