[swift-evolution] Trial balloon: conforming sizeof, sizeofValue, etc. to naming guidelines
Xiaodi Wu
xiaodi.wu at gmail.com
Sun May 1 21:03:40 CDT 2016
See:
// FIXME(ABI)(compiler limitation): We'd like to name this type "Distance"
// but for <rdar://problem/17619038>
On Sun, May 1, 2016 at 20:51 Dave Abrahams <dabrahams at apple.com> wrote:
>
> on Sun May 01 2016, Xiaodi Wu <xiaodi.wu-AT-gmail.com> wrote:
>
> > 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,
>
> Not only those. UnsafePointer is strideable, for example.
>
> > 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 don't *think* so.
>
> > 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
>
> You're going to see a definition of Int.Stride when you look at the
> members.
>
> --
> Dave
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160502/85082860/attachment.html>
More information about the swift-evolution
mailing list