on Wed Jul 05 2017, Jens Persson wrote:
> On Wed, Jul 5, 2017 at 11:50 PM, Dave Abrahams via swift-users <
> swift-users@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
>> lik
On Wed, Jul 5, 2017 at 11:50 PM, Dave Abrahams via swift-users <
swift-users@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,
On Wed, Jul 5, 2017 at 6:52 PM, Zhao Xin wrote:
> For your specific question, `func signum() -> Self` returns `Self`, which
> can't be used in property.
> `var signum:Self { return self }` will generate an error "'Self' is only
> available in a protocol or as the result of a method in a class".
>
on Wed Jul 05 2017, Jens Persson wrote:
> Why is eg the BinaryInteger.signum() a method and not a computed property?
>
> public protocol BinaryInteger … {
> /// Returns `-1` if this value is negative and `1` if it's positive;
> /// otherwise, `0`.
> ///
> /// - Returns: The sign
For me, a noun is a property, a verb is a method. So `foo` is a property,
`calculateFoo()` is a method.
For your specific question, `func signum() -> Self` returns `Self`, which
can't be used in property.
`var signum:Self { return self }` will generate an error "'Self' is only
available in a proto
Why is eg the BinaryInteger.signum() a method and not a computed property?
public protocol BinaryInteger … {
/// Returns `-1` if this value is negative and `1` if it's positive;
/// otherwise, `0`.
///
/// - Returns: The sign of this number, expressed as an integer of the
same