Re: Should ... be suffix rather than prefix?

2012-04-10 Thread Herby Vojčík
Andreas Rossberg wrote: On 3 April 2012 22:16, Mark S. Miller mailto:erig...@google.com>> wrote: foo(a, b, ...rest) vs foo(a, b, rest...) Which is clearer? First, because it is much more apparent that 'rest' is a different beast than the other parameters. The sec

Re: Should ... be suffix rather than prefix?

2012-04-10 Thread Andreas Rossberg
On 3 April 2012 22:16, Mark S. Miller wrote: > foo(a, b, ...rest) > > vs > > foo(a, b, rest...) > > Which is clearer? First, because it is much more apparent that 'rest' is a different beast than the other parameters. The second form "looks" natural but in a rather misleading way. ES6

Re: Should ... be suffix rather than prefix?

2012-04-09 Thread Brendan Eich
Kyle Murray wrote: Two dots are (in some contexts) the descendant access operator in E4X, so that might have had something to do with the decision. Even in plain JS without E4X [1], two dots are one way to access prototype methods of a floating point literal: js> 42..toString(16) "2a" and e

Re: Should ... be suffix rather than prefix?

2012-04-07 Thread Kyle Murray
Two dots are (in some contexts) the descendant access operator in E4X, so that might have had something to do with the decision. On Wed, Apr 4, 2012 at 4:32 PM, Claus Reinke wrote: > Btw, why three dots? I always find myself writing two dots.. >>> >> >> Presumably because three dots make an ellip

Re: Should ... be suffix rather than prefix?

2012-04-04 Thread Claus Reinke
Btw, why three dots? I always find myself writing two dots.. Presumably because three dots make an ellipsis, which has roughly the meaning we're aiming for here. True, and I admit to omitting that third dot in natural language as well. But in the context of JS, if I think of ... as the anonym

Re: Should ... be suffix rather than prefix?

2012-04-04 Thread Tab Atkins Jr.
On Wed, Apr 4, 2012 at 7:03 AM, Claus Reinke wrote: > Btw, why three dots? I always find myself writing two dots.. Presumably because three dots make an ellipsis, which has roughly the meaning we're aiming for here. ~TJ ___ es-discuss mailing list es-d

Re: Should ... be suffix rather than prefix?

2012-04-04 Thread Claus Reinke
foo(a, b, ...rest) vs foo(a, b, rest...) Which is clearer? The former suggests a special construct that may have a name, the latter suggests a variable of a special kind. But there isn't anything special about the variable (a or b could be Arrays, too), so I find the suffix form mislead

Re: Should ... be suffix rather than prefix?

2012-04-03 Thread Irakli Gozalishvili
Second feels more intuitive to me Regards -- Irakli Gozalishvili Web: http://www.jeditoolkit.com/ On Tuesday, 2012-04-03 at 13: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

Re: Should ... be suffix rather than prefix?

2012-04-03 Thread Allen Wirfs-Brock
I find the prefix more readable, in both situations. I read from left to right, and it is clearer when the most semantically important symbol comes as early as possible in that left to right progression. Allen On Apr 3, 2012, at 2:32 PM, Erik Arvidsson wrote: > FWIW, Python and Ruby uses pref

Re: Should ... be suffix rather than prefix?

2012-04-03 Thread Jorge
On Apr 3, 2012, at 10:16 PM, 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. The second, of course. As in C: the ellipsis always ends the parameters list.

Re: Should ... be suffix rather than prefix?

2012-04-03 Thread Erik Arvidsson
FWIW, Python and Ruby uses prefix (the * operator). Java and C++11 uses prefix ... (actually suffix on the type). My vote is for prefix. On Tue, Apr 3, 2012 at 14:08, Russell Leggett wrote: > Second... > > In fact, I think I've even written a few code examples accidentally using > that form bec

Re: Should ... be suffix rather than prefix?

2012-04-03 Thread Russell Leggett
Second... In fact, I think I've even written a few code examples accidentally using that form because it was just more natural. On Tue, Apr 3, 2012 at 4:16 PM, Mark S. Miller wrote: > foo(a, b, ...rest) > > vs > > foo(a, b, rest...) > > Which is clearer? > > ES6 has currently agreed on

Re: Should ... be suffix rather than prefix?

2012-04-03 Thread Axel Rauschmayer
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

Re: Should ... be suffix rather than prefix?

2012-04-03 Thread Peter van der Zee
Second... On Tue, Apr 3, 2012 at 10:16 PM, 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 >

Should ... be suffix rather than prefix?

2012-04-03 Thread Mark S. Miller
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