July notes: copySlice --> copyWithin ??

Rick Waldron waldron.rick at gmail.com
Wed Aug 14 10:00:46 PDT 2013


On Tue, Aug 13, 2013 at 9:50 PM, Brendan Eich <brendan at mozilla.com> wrote:

> 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<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!


copySlice/copyWithin is similar to the subset assignment operation in R,
eg. vec[4:6] <- vec[1:3]

Array.prototype.subset(target = 0, start = 0, end = this.length)?


Rick



>
>
> /be
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130814/f06ff8d6/attachment.html>


More information about the es-discuss mailing list