July notes: copySlice --> copyWithin ??

Brendan Eich brendan at mozilla.com
Tue Aug 13 18:50:26 PDT 2013

Rick Waldron wrote:
> On Tue, Aug 13, 2013 at 7:27 PM, Allen Wirfs-Brock 
> <allen at wirfs-brock.com <mailto:allen at wirfs-brock.com>> wrote:
>     Re
>     https://github.com/rwldrn/tc39-notes/blob/master/es6/2013-07/july-23.md#42-add-fill-and-copyslice-methods-to-arrayprototype-and-typed-arrays
>     From the notes, it's unclear whether there was consensus on using
>     the name "copyWithin" in place of "copySlice".  My recollection is
>     that "copyWithin" was generally  preferred by those at in the
>     discussion.  Does anyone else remember?
> When I went to file this as a bug, I realized that we held off 
> recording a consensus (waiting for Brendan's input), but we never came 
> back to it.

I will try to avoid missing even a day of TC39, it clearly has taken 
some toll! ;-)

Given the in-place |this|-mutating update done by copyWithin, I'm ok 
with the name. But it seems to suggest "within current [0, length) 
bounds" -- i.e., no extension of the |this| arraylike. Yet it can of 
course extend.

In contrast, "fill" takes optional slice parameters but has a short 
name. Perhaps we would be better with either

copy : fill :: copySlice : fillSlice

Thoughts? Naming is hard, let's not rush it. One more round of bikeshed 
paint-color debate!


More information about the es-discuss mailing list