On Jan 2, 2012, at 11:45 PM, Axel Rauschmayer wrote:
Prefix might work, too.
¿x?
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
Rick Waldron wrote:
On Mon, Jan 2, 2012 at 3:56 PM, Mariusz Nowak
medikoo+mozilla@medikoo.com wrote:
I like it, it indeed looks very logical, however it's a bit controversial
that we need to create temporary array object to get one that we want.
Is the controversy editorial or
?? would work better than ? in JavaScript, because it wouldn’t clash with the
conditional operator in JavaScript
Wouldn't it be possible to use a single '?' for all of them (the conditional,
default and existential operators) and disambiguate between them according to
the way they're
On 3 January 2012 07:21, Brendan Eich bren...@mozilla.com wrote:
It's not obvious if the static scope is built up from sript element to
successive script element, either. Must I read all the scripts? The
conditionally generated ones too?
The top level is hard. The only way to be sure is to
On 3 January 2012 07:19, Brendan Eich bren...@mozilla.com wrote:
[Dave has been traveling, hope it's ok for me to jump in. /be]
On Jan 2, 2012, at 6:07 AM, Andreas Rossberg wrote:
In other words, I think the main points of your proposal can
essentially be rephrased to:
1) Rename use
Hello,
binary ftw. See http://jsperf.com/array-repeat/4 Array.prototype.repeatD.
And I also tried push.apply in repeatC (not to copy over the array using
concat but grow it in place until possible) and it really surprised me it
was that much slower. Concat is probably heavily optimized.
Hello,
form what I understood in the class proposal, I can write a code like this:
(function () { return private(this).foo; }).apply(objectWithPrivateFoo);
and it will work.
Is it so? Isn’t then the notion of per-object private impossible having
dynamic language with first-class function and
Hello,
in certain application, Unicode de/normalization and possibility to query
what group the character is is vital, but ECMAScript does not have these
methods nor did I see them in any of the proposals?
Are they planned? Or can they be added?
Thanks, Herby
repeatD(10) returns 17 copies, not 10.
On Tue, Jan 3, 2012 at 4:28 AM, Herby Vojčík he...@mailbox.sk wrote:
Hello,
binary ftw. See http://jsperf.com/array-repeat/4 Array.prototype.repeatD.
And I also tried push.apply in repeatC (not to copy over the array using
concat but grow it in place
On Tue, Jan 3, 2012 at 3:34 AM, Mariusz Nowak
medikoo+mozilla@medikoo.com wrote:
Rick Waldron wrote:
On Mon, Jan 2, 2012 at 3:56 PM, Mariusz Nowak
medikoo+mozilla@medikoo.com wrote:
I like it, it indeed looks very logical, however it's a bit
controversial
that we need
Sorry, fixed (you get the idea, anyway, doing 10 concats is worse than doing
five of them, with _big_ chunks of data in the last calls). There is a
checking throw in the end so it really works now.
Now it is even more faster :-)
Herby
-Pôvodná správa-
From: felix
Sent: Tuesday,
Rick Waldron wrote:
On Tue, Jan 3, 2012 at 3:34 AM, Mariusz Nowak
medikoo+mozilla@medikoo.com wrote:
Rick Waldron wrote:
On Mon, Jan 2, 2012 at 3:56 PM, Mariusz Nowak
medikoo+mozilla@medikoo.com wrote:
I like it, it indeed looks very logical, however it's a bit
On Tue, Jan 3, 2012 at 9:19 AM, Mariusz Nowak
medikoo+mozilla@medikoo.com wrote:
Rick Waldron wrote:
On Tue, Jan 3, 2012 at 3:34 AM, Mariusz Nowak
medikoo+mozilla@medikoo.com wrote:
Rick Waldron wrote:
On Mon, Jan 2, 2012 at 3:56 PM, Mariusz Nowak
I see Array.contains as a great idea. This is an operation I use constantly
when I write code and it'd be nice to have it be a first class Array
operation. Sure it's not so different than indexOf, but the semantics are
much more intuitive and it may very well be the more common operation.
-Greg
What is the use case for .repeat? Trying to imagine some code where I'd
need it so I can get a feel for how it should work.
On Tue, Jan 3, 2012 at 9:19 AM, Mariusz Nowak
medikoo+mozilla@medikoo.com wrote:
Rick Waldron wrote:
On Tue, Jan 3, 2012 at 3:34 AM, Mariusz Nowak
Sorry I meant Array.prototype.contains
On Tue, Jan 3, 2012 at 9:46 AM, Greg Smith g...@bocoup.com wrote:
I see Array.contains as a great idea. This is an operation I use
constantly when I write code and it'd be nice to have it be a first class
Array operation. Sure it's not so different than
Rick Waldron wrote:
On Tue, Jan 3, 2012 at 9:19 AM, Mariusz Nowak
medikoo+mozilla@medikoo.com wrote:
Rick Waldron wrote:
On Tue, Jan 3, 2012 at 3:34 AM, Mariusz Nowak
medikoo+mozilla@medikoo.com wrote:
Rick Waldron wrote:
On Mon, Jan 2, 2012 at 3:56 PM,
On Tue, Jan 3, 2012 at 10:16 AM, Mariusz Nowak
medikoo+mozilla@medikoo.com wrote:
Rick Waldron wrote:
On Tue, Jan 3, 2012 at 9:19 AM, Mariusz Nowak
medikoo+mozilla@medikoo.com wrote:
Rick Waldron wrote:
On Tue, Jan 3, 2012 at 3:34 AM, Mariusz Nowak
*Only* if that code appears appears within the text of the class of
which objectWithPrivateFoo is an instance. foo is what we call a class
private instance variable, which is essentially the same degree of
encapsulation as Java's private fields -- instances of the class can see
into other
Hello,
*Only* if that code appears appears within the text of the class
ClassWithPrivateFoo means only inside class {...} block that defines
ClassWithPrivateFoo? So ES.next private could be seen as sugar for lexical
private in scope of class block?
Herby
-Pôvodná správa-
From:
On Jan 3, 2012, at 15:46 , Greg Smith wrote:
What is the use case for .repeat? Trying to imagine some code where I'd need
it so I can get a feel for how it should work.
So beauty alone does not count? ;-)
It’s true – there are not a lot of use cases for Array.repeat().
But I keep thinking
I think it's fairly common for range implementations to provide an optional
`step` parameter
On Tue, Jan 3, 2012 at 12:08 PM, Axel Rauschmayer a...@rauschma.de wrote:
On Jan 3, 2012, at 15:46 , Greg Smith wrote:
What is the use case for .repeat? Trying to imagine some code where I'd
need it
I think it's fairly common for range implementations to provide an optional
`step` parameter
Good point. Maybe all of these parameters should be options:
Array.range() - 0, 1, 2, 3, ...
Array.range({ start: 3 }) - 3, 4, 5, 6, ...
Array.range({ end: 5 }) - 0, 1, 2, 3, 4
Array.range({ step: 3
I think step should be 0, and step towards end:
Array.range({start: 5, end: 0, step: 2}) - 5, 3, 1
On Tue, Jan 3, 2012 at 11:42 AM, Axel Rauschmayer a...@rauschma.de wrote:
I think it's fairly common for range implementations to provide an optional
`step` parameter
Good point. Maybe all of
Either way is fine with me. But it’s probably best to copy Python’s semantics:
http://docs.python.org/py3k/library/functions.html#range
On Jan 3, 2012, at 18:50 , Sean Eagan wrote:
I think step should be 0, and step towards end:
Array.range({start: 5, end: 0, step: 2}) - 5, 3, 1
On Tue,
I would be more in favor of something like the code below, its just a
proof of concept.
Array.prototype.range = function (value, start, end, step) {
if (typeof value === number) {
end = (start = 0 value = 0) ? Math.min(value, start) : 0;
start = (start = 0 value = 0) ?
When working on Array.prototype.range (among many others) I noticed
that being able to specify the sign of a numeric would quicken code's
readability. Take the following proof of concept from
Array.prototype.range and compare it to the signed variable example.
Array.prototype.range = function
On Tue, Jan 3, 2012 at 12:50 PM, Sean Eagan seaneag...@gmail.com wrote:
I think step should be 0, and step towards end:
Array.range({start: 5, end: 0, step: 2}) - 5, 3, 1
This would be an unfortunate limitation, considering real world impl's
allow negative numbers...
Good point. Maybe all of these parameters should be options:
Array.range() - 0, 1, 2, 3, ...
Array.range({ start: 3 }) - 3, 4, 5, 6, ...
Array.range({ end: 5 }) - 0, 1, 2, 3, 4
Array.range({ step: 3 }) - 0, 3, 6, 9, ...
Array.range({ start: -2, step: -1 }) - -2, -3, -4, -5, ...
etc.
Why
When I first started learning JavaScript I didn't understand how
new Array(n);
worked, in that it creates an empty array with a length of n. What I
had expected was an array with n values (even if it wasn't
well-defined what those values should be). So of course my attempt to
create an array of
Sorry - I had my email address misconfigured so it rejected my email.
Sending it again:
Added my own repeatF() to the tests at http://jsperf.com/array-repeat/6.
Seems to be much faster than the others, at least on V8.
On Tue, Jan 3, 2012 at 2:28 PM, Herby Vojčík he...@mailbox.sk wrote:
On Jan 3, 2012, at 1:29 AM, Andreas Rossberg wrote:
On 3 January 2012 07:21, Brendan Eich bren...@mozilla.com wrote:
It's not obvious if the static scope is built up from sript element to
successive script element, either. Must I read all the scripts? The
conditionally generated ones too?
On Tue, Jan 3, 2012 at 8:45 AM, Herby Vojčík he...@mailbox.sk wrote:
Hello,
*Only* if that code appears appears within the text of the class
ClassWithPrivateFoo means only inside class {...} block that defines
ClassWithPrivateFoo? So ES.next private could be seen as sugar for
lexical
On Jan 3, 2012, at 12:01 PM, Brendan Eich wrote:
On Jan 3, 2012, at 1:29 AM, Andreas Rossberg wrote:
...
For multi-part scripts we need a way to switch the
_proper_ top-level into extended mode. Or should I not be able to
write (the relevant bits of) a multi-part script in extended
On Jan 3, 2012, at 1:29 AM, Andreas Rossberg wrote:
On 3 January 2012 07:19, Brendan Eich bren...@mozilla.com wrote:
[Dave has been traveling, hope it's ok for me to jump in. /be]
On Jan 2, 2012, at 6:07 AM, Andreas Rossberg wrote:
In other words, I think the main points of your proposal
On Jan 3, 2012, at 12:16 PM, Allen Wirfs-Brock wrote:
On Jan 3, 2012, at 12:01 PM, Brendan Eich wrote:
On Jan 3, 2012, at 1:29 AM, Andreas Rossberg wrote:
...
For multi-part scripts we need a way to switch the
_proper_ top-level into extended mode. Or should I not be able to
write
Hello,
overall I believe in making classes and literals as close as possible. I
think at least semantics of things they have in common should be identical.
In http://wiki.ecmascript.org/doku.php?id=harmony:classes, this is written:
By default, data properties define enumerable prototype
On Jan 3, 2012, at 12:18 PM, Brendan Eich wrote:
Maybe. We tried in 2006-2007 and ran into at least this:
https://bugzilla.mozilla.org/show_bug.cgi?id=351515
where 'yield' was used as a parameter name. I dimly recall 'let' in the wild
but may be misremembering. Perhaps out of paranoia we
Just Two Modes
This is a long thread and I've been completely busy with other things so
have not had time to do more than skim. So please understand if the post
below misses some context. The following is a summary of some principles
that Dave and just agreed to in a
On Jan 3, 2012, at 12:28 PM, Gavin Barraclough wrote:
On Jan 3, 2012, at 12:18 PM, Brendan Eich wrote:
Maybe. We tried in 2006-2007 and ran into at least this:
https://bugzilla.mozilla.org/show_bug.cgi?id=351515
where 'yield' was used as a parameter name. I dimly recall 'let' in the
On Jan 3, 2012, at 1:24 PM, Mark S. Miller wrote:
Just Two Modes
V8 folks the other year had a catchier version: no more modes.
* ES6 non-strict mode must be practically upwards compatible from ES5
non-strict mode.
This is the part that's not clearly agreed to,
On Jan 3, 2012, at 3:27 PM, Brendan Eich wrote:
You're proposing that we require 'let' be only at the start of statements? If
so, then destructuring is problematic:
foo();
let [x] = y;
Did that last line destructure the property named '0' of the object denoted
by y into a
On Jan 3, 2012, at 4:31 PM, Gavin Barraclough wrote:
On Jan 3, 2012, at 3:27 PM, Brendan Eich wrote:
You're proposing that we require 'let' be only at the start of statements?
If so, then destructuring is problematic:
foo();
let [x] = y;
Did that last line destructure the property
On Jan 3, 2012, at 4:31 PM, Gavin Barraclough wrote:
On Jan 3, 2012, at 3:27 PM, Brendan Eich wrote:
You're proposing that we require 'let' be only at the start of statements?
If so, then destructuring is problematic:
foo();
let [x] = y;
Did that last line destructure the property
On Jan 3, 2012, at 4:38 PM, Allen Wirfs-Brock wrote:
ArrayBindingPattern :
[ Elisionopt BindingRestElementopt ]
[ BindingElementList , Elisionopt BindingRestElementopt ]
It's a grammar bug. Thanks for the proof reading...
The final opt cited above is the bug, right?
The first
On Jan 3, 2012, at 4:42 PM, Brendan Eich wrote:
On Jan 3, 2012, at 4:38 PM, Allen Wirfs-Brock wrote:
ArrayBindingPattern :
[ Elisionopt BindingRestElementopt ]
[ BindingElementList , Elisionopt BindingRestElementopt ]
It's a grammar bug. Thanks for the proof reading...
The
On Jan 3, 2012, at 4:42 PM, Brendan Eich wrote:
On Jan 3, 2012, at 4:38 PM, Allen Wirfs-Brock wrote:
ArrayBindingPattern :
[ Elisionopt BindingRestElementopt ]
[ BindingElementList , Elisionopt BindingRestElementopt ]
It's a grammar bug. Thanks for the proof reading...
The
On Jan 3, 2012, at 4:50 PM, Gavin Barraclough wrote:
On Jan 3, 2012, at 4:42 PM, Brendan Eich wrote:
On Jan 3, 2012, at 4:38 PM, Allen Wirfs-Brock wrote:
ArrayBindingPattern :
[ Elisionopt BindingRestElementopt ]
[ BindingElementList , Elisionopt BindingRestElementopt ]
It's a
Ah, I see! - Thanks.
On Jan 3, 2012, at 4:58 PM, Brendan Eich wrote:
On Jan 3, 2012, at 4:50 PM, Gavin Barraclough wrote:
On Jan 3, 2012, at 4:42 PM, Brendan Eich wrote:
On Jan 3, 2012, at 4:38 PM, Allen Wirfs-Brock wrote:
ArrayBindingPattern :
[ Elisionopt BindingRestElementopt ]
On Tue, Jan 3, 2012 at 4:08 PM, Brendan Eich bren...@mozilla.com wrote:
On Jan 3, 2012, at 1:24 PM, Mark S. Miller wrote:
Just Two Modes
V8 folks the other year had a catchier version: no more modes.
I am happy with that ;).
* ES6 non-strict mode must be
On Jan 3, 2012, at 9:52 PM, Mark S. Miller wrote:
A good example. Since the class proposal uses private, public, static, by
these principles, it would only be recognized in strict mode. If it appears
in non-strict code, it would be a SyntaxError.
That's a choice. I'm asking why it's the
On Tue, Jan 3, 2012 at 10:18 PM, Brendan Eich bren...@mozilla.com wrote:
On Jan 3, 2012, at 9:52 PM, Mark S. Miller wrote:
A good example. Since the class proposal uses private, public,
static, by these principles, it would only be recognized in strict mode.
If it appears in non-strict
52 matches
Mail list logo