[swift-evolution] Trial balloon: conforming sizeof, sizeofValue, etc. to naming guidelines

Xiaodi Wu xiaodi.wu at gmail.com
Sun May 1 20:15:08 CDT 2016


On Sun, May 1, 2016 at 7:01 PM, Dave Abrahams via swift-evolution <
swift-evolution at swift.org> wrote:

>
> on Sun May 01 2016, Xiaodi Wu <swift-evolution at swift.org> wrote:
>
> > A clash of names is inelegant, but in practice, I'm not actually sure
> that
> > there's really a lack of clarity. IMO, `stride(of: Int)` is not really
> > misinterpretable as anything else.
>
> I disagree, especially since `Strideable` has an associated `Stride` type.


Is the naming infelicitous? Yes, no argument from me here.

But: I'd guess that Strideable, being a protocol for numeric types, comes
into the picture mostly when implementing generic numeric algorithms, and
its associated Stride type (if I remember correctly from reading code
comments) should really be Distance but for current limitations in the
language. I have no doubt that someone who knows the insides of Strideable
to that level of detail has the expertise and imagination to conjure up a
meaning for `stride(of: Int)` other than the stride size in bytes of
consecutive Ints, but I venture that it'd still take some effort and
wouldn't be an unintentional misunderstanding :P
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160501/16a909f0/attachment.html>


More information about the swift-evolution mailing list