July notes: copySlice --> copyWithin ??
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:
>> 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)?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss