New ES6 strawman: Array.prototype.fill and Array.prototype.move

Brendan Eich brendan at mozilla.com
Sun Jun 23 13:11:29 PDT 2013


Axel Rauschmayer wrote:
> On Jun 23, 2013, at 21:21 , Allen Wirfs-Brock <allen at wirfs-brock.com 
> <mailto:allen at wirfs-brock.com>> wrote:
>
>> See 
>> http://wiki.ecmascript.org/doku.php?id=strawman:array_fill_and_move for 
>> a strawman proposal for two new Array methods.  These are proposed 
>> for inclusion in ES6.
>
> Array.prototype.move = function move(target=0,source=0, count=this.length-source)
> Is the case of moving trailing elements somewhere else very common? If 
> not, then I’d define the parameters in this order: source, count, target.
> Rationale: easier to memorize.

No, assignment-expression LHS/RHS (target/source) order precedent wins 
for memorization (see Object.extend precedent, strcpy, memcpy, etc.).

Allen: where is the Khronos draft spec on move? I can't find it.

/be

>
> -- 
> Dr. Axel Rauschmayer
> axel at rauschma.de <mailto:axel at rauschma.de>
>
> home: rauschma.de <http://rauschma.de>
> twitter: twitter.com/rauschma <http://twitter.com/rauschma>
> blog: 2ality.com <http://2ality.com>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss


More information about the es-discuss mailing list