Should ... be suffix rather than prefix?

Axel Rauschmayer axel at rauschma.de
Tue Apr 3 13:31:23 PDT 2012


Call me crazy, but I’d use postfix for a declaration of a rest parameter and prefix for spreading. To me, prefix feels like it does something, while postfix has more of a declarative feel.

function foo(a, rest...) {
    bar(...rest);
}

Whatever we choose, people will get used to it. So I don’t think it matters much.


On Apr 3, 2012, at 22:16 , Mark S. Miller wrote:

>     foo(a, b, ...rest)
> 
> vs
> 
>     foo(a, b, rest...)
> 
> Which is clearer?
> 
> ES6 has currently agreed on the first. English and Scheme agree on the second.
> 
> This question applies to both <http://wiki.ecmascript.org/doku.php?id=harmony:rest_parameters> and <http://wiki.ecmascript.org/doku.php?id=harmony:spread>.
> 
> -- 
>     Cheers,
>     --MarkM
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss

-- 
Dr. Axel Rauschmayer
axel at rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120403/2705e372/attachment-0001.html>


More information about the es-discuss mailing list