<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div class="">On Jun 30, 2016, at 10:41 PM, Xiaodi Wu <<a href="mailto:xiaodi.wu@gmail.com" class="">xiaodi.wu@gmail.com</a>> wrote:</div><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On Fri, Jul 1, 2016 at 12:03 AM, Dave Abrahams via swift-evolution <span dir="ltr" class=""><<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class=""><br class="">
on Thu Jun 30 2016, John McCall <<a href="http://rjmccall-at-apple.com" class="">rjmccall-AT-apple.com</a>> wrote:<br class="">
<br class="">
>> On Jun 30, 2016, at 6:12 PM, Dave Abrahams via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class="">
</span><div class=""><div class="h5">>> on Thu Jun 30 2016, Matthew Johnson <<a href="http://matthew-at-anandabits.com" class="">matthew-AT-anandabits.com</a> <<a href="http://matthew-at-anandabits.com/" rel="noreferrer" target="_blank" class="">http://matthew-at-anandabits.com/</a>>> wrote:<br class="">
>><br class="">
>>> Sent from my iPad<br class="">
>>><br class="">
><br class="">
>>>> On Jun 30, 2016, at 6:59 PM, Erica Sadun via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class="">
>>>><br class="">
>>>><br class="">
>>>>>> On Jun 30, 2016, at 5:47 PM, James Berry <<a href="mailto:jberry@rogueorbit.com" class="">jberry@rogueorbit.com</a>> wrote:<br class="">
>>>>>><br class="">
>>>>>><br class="">
>>>>>> On Jun 30, 2016, at 4:05 PM, Dave Abrahams via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class="">
>>>>>> on Thu Jun 30 2016, Erica Sadun <<a href="http://erica-at-ericasadun.com" class="">erica-AT-ericasadun.com</a>> wrote:<br class="">
>>>>>><br class="">
>>>>>>>> On Jun 30, 2016, at 4:41 PM, Dave Abrahams <<a href="mailto:dabrahams@apple.com" class="">dabrahams@apple.com</a>> wrote:<br class="">
>>>>>>>>> I mentioned this in a comment on the gist already, but I'm really not<br class="">
>>>>>>>>> digging the "array" in `arraySpacing`. We've already moved from top-level<br class="">
>>>>>>>>> "stride" to "memory layout spacing," gaining plenty of clarity. I'm<br class="">
>>>>>>>>> skeptical that the "array" adds anything more. Moreover, it muddies the<br class="">
>>>>>>>>> waters by mentioning a specific type (Array) in a context where you're<br class="">
>>>>>>>>> querying the memory layout properties of another type.<br class="">
>>>>>>>><br class="">
>>>>>>>> OK, I agree with that. If we have “alignment” rather than<br class="">
>>>>>>>> “defaultAlignment,” I suppose we can have plain “spacing.”<br class="">
>>>>>>><br class="">
>>>>>>> No way to last-second sell you on interval rather than spacing?<br class="">
>>>>>><br class="">
>>>>>> If you can explain why it's better.<br class="">
>>>>>><br class="">
>>>>>>> // Returns the least possible interval between distinct instances of<br class="">
>>>>>>> /// `T` in memory. The result is always positive.<br class="">
>>>>>><br class="">
>>>>>> For me, “interval” doesn't go with “size” and “alignment,” which are all<br class="">
>>>>>> about physical distances and locations. There are all kinds of<br class="">
>>>>>> “intervals,” e.g. time intervals.<br class="">
>>>>><br class="">
>>>>> Hmm. Sounds like stride to me. stride or byteStride?<br class="">
>>>>><br class="">
>>>>> James<br class="">
>>>><br class="">
>>>> FAQ: "Why aren't you using the obvious phrase `stride` for something that clearly<br class="">
>>>> returns the memory stride?"<br class="">
>>>><br class="">
>>>> ANSWER: "As stride already has a well-established meaning in the standard library,<br class="">
>>>> this proposal changes the name to spacing, providing a simple but correct name that<br class="">
>>>> works well enough in its intended use. Measuring memory is sufficiently esoteric<br class="">
>>>> that we prefer to reserve `stride` for a more common use case."<br class="">
>>><br class="">
>>> Counter: some words have more than one well established meaning when<br class="">
>>> used in different contexts. 'spacing' isn't too bad here (much better<br class="">
>>> than 'arraySpacing') but sticking to the term of art 'stride' would be<br class="">
>>> best IMO. As James mentioned, spacing implies empty space *between*<br class="">
>>> items whereas stride matches the meaning of this property *exactly*<br class="">
>>> (which is why it is the term of art).<br class="">
>>><br class="">
>>> If a programmer can't distinguish between a 'stride' property on<br class="">
>>> MemoryLayout and the 'stride' function they probably have no business<br class="">
>>> doing anything which requires use of MemoryLayout in the first place.<br class="">
>><br class="">
>> I don't believe that “stride” *is* the accepted term of art for this<br class="">
>> meaning. I never heard of the idea of types having an intrinsic<br class="">
>> “stride” until I arrived on the Swift project. That usage came from<br class="">
>> “strideof.”<br class="">
>><br class="">
>> If you all swear up and down that you've been talking about “the stride<br class="">
>> of a type” for more than 2 years, I won't fight you on this.<br class="">
>> Otherwise... well, I still won't fight; I'm being crushed by an<br class="">
>> avalanche of bikesheds and I can't muster the energy ;->... but I'll<br class="">
>> forever be plagued by doubts about the name.<br class="">
><br class="">
> As the person who originally picked "stride" here, I agree that I've never<br class="">
> heard of people talking about the "stride" of a type; people talk about striding<br class="">
> over an array, and they talk about the size of one's stride, and that size<br class="">
> can be measured in bytes. That's all I was thinking.<br class="">
><br class="">
> However, I was just picking a name for an internal implementation concept;<br class="">
> I did not expect it to be used in the standard library.<br class="">
><br class="">
> I don't really like "spacing"; it sounds too much like a synonym for "padding",<br class="">
> i.e. the amount of empty space between elements rather than the total amount<br class="">
> of space for each element. But I don't mean to re-open wounds; if people<br class="">
> have settled on "spacing", have at it.<br class="">
<br class="">
</div></div>Better names are always welcome if you can come up with one.<br class=""></blockquote><div class=""><br class=""></div><div class="">FWIW, courtesy of the thesaurus, curated to eliminate clearly unsuitable words:<br class=""><div class="">breadth, dimension, expanse, interval, period, space, span, stretch, width</div></div><div class=""><br class=""></div><div class="">Of these, span might be the most OK.</div></div></div></div></div></blockquote><div><br class=""></div></div>Another thought is "arrayElementSize", or "sizeAsArrayElement", or "sizeInArray". Somewhat verbose, though.<div class=""><br class=""></div><div class="">John.</div></body></html>