[swift-evolution] [Review] SE-0067: Enhanced Floating Point Protocols
Xiaodi Wu
xiaodi.wu at gmail.com
Wed Apr 20 15:08:51 CDT 2016
I'm saying something else. The preposition that goes with "less" is "than,"
while "to" goes only with "equal." By making "to" a parameter label you've
got {less than or equal} to, which is inelegant because the label cannot be
distributed to both parts--i.e. one cannot say "less than to or equal to."
Put another way, I could just as well rewrite the method as
`equalToOrLess(than:)`. Now, the parameter is labeled "than" instead of
"to," yet the parameter serves the same purpose. Thus, I argue that the
proposed method name may meet the letter of the Swift guidelines but is
awkward.
On Wed, Apr 20, 2016 at 14:44 Dave Abrahams via swift-evolution <
swift-evolution at swift.org> wrote:
>
> on Tue Apr 19 2016, Xiaodi Wu <swift-evolution at swift.org> wrote:
>
> > * What is your evaluation of the proposal?
> >
> > +1 in intent. Specifics require further refinement. For example:
> >
> > Internal inconsistencies in capitalization:
> > * `signalingNaN` but `isSignalingNan` and `isNan`
> >
> > Parameter labels, or whatever they're called now, do not reflect newly
> > adopted Swift syntax in SE-0046:
> > * `static func maximum(x: Self, _ y: Self) -> Self` should be `static
> > func maximum(_ x: Self, _ y: Self) -> Self`, etc.
> >
> > Infelicitous use of prepositions to conform superficially to new
> > naming guidelines:
> > * `isEqual(to:)` is fine, but for consistency there's
> > `isLessThanOrEqual(to:)`, which is not fine, because the preposition
> > "to" applies only to "equal" and not to "less than"
>
> That seems like a huge stretch to me. Are you claiming it's wrong to
> say “x is less than or equal to y,” or are you saying something else?
>
> --
> Dave
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160420/85d047a1/attachment.html>
More information about the swift-evolution
mailing list