Re: Array.prototype.take

2012-05-25 Thread Strager Neds
[1,2,3,4,3,2,1].takeWhile((x) = x 4) = [1,2,3] correct? (I use 'takeWhile' here because it is what functional languages use [1]; 'take' takes a fixed number of elements from a list.) This is not the same as map+filter. (I'm not sure how map even would come into play; you're not transforming

Re: Generators improvement idea

2012-05-25 Thread François REMY
While we're at it, I had an idea to allow to avoid the function*() {} syntax: why not yield [noLineTerminator] return ? Since return is a reserved word which can only appear as first token of an instruction, enforcing [noLineTerminator] makes sure any recognized use of 'yield return' in ES6

Re: const classes for max/min

2012-05-25 Thread Axel Rauschmayer
Couldn’t #1 (optionally) be handled via a proxy and #2+#3 via static analysis? On May 24, 2012, at 22:50 , Erik Arvidsson wrote: I think it is impossible to achieve Waldemar's goal with syntactic sugar only. I also don't think that is reason enough to block ES6 classes. The requirements he

Re: Generators improvement idea

2012-05-25 Thread Rick Waldron
On Fri, May 25, 2012 at 2:10 AM, François REMY fremycompany_...@yahoo.frwrote: While we're at it, I had an idea to allow to avoid the function*() {} syntax: why not yield [noLineTerminator] return ? This approach expects all future readers of my code to look deep into the function definition

Re: const classes for max/min

2012-05-25 Thread Brendan Eich
Axel Rauschmayer wrote: Couldn’t #1 (optionally) be handled via a proxy and #2+#3 via static analysis? Don't bring up proxies as a solution here! Direct proxies require target objects, which are both irrelevant and unacceptably high overhead. /be

Re: Arity checking?

2012-05-25 Thread Brendan Eich
Axel Rauschmayer wrote: I was under the impression that ECMAScript.next was going to perform arity checking. But looking at the proposals and the draft spec, it doesn’t look like it. How would that work? It's impossible under 1JS. I can see pros and cons either way. I take it that the

Re: const classes for max/min

2012-05-25 Thread Allen Wirfs-Brock
On May 24, 2012, at 1:50 PM, Erik Arvidsson wrote: I think it is impossible to achieve Waldemar's goal with syntactic sugar only. I also don't think that is reason enough to block ES6 classes. The requirements he wants cannot be expressed with ES5 semantics. I'm actually rather this

Re: announcing normative ECMAScript specification in HTML

2012-05-25 Thread Axel Rauschmayer
Great! Suggestion: one file per chapter (faster, especially on mobile devices). The TOC either in its own file or before the copyright information would be more convenient, too. I'd expect it to always be the starting point for browsing the spec. [[[Sent from a mobile device. Please forgive

Re: Arity checking?

2012-05-25 Thread Axel Rauschmayer
Axel Rauschmayer wrote: I was under the impression that ECMAScript.next was going to perform arity checking. But looking at the proposals and the draft spec, it doesn’t look like it. How would that work? It's impossible under 1JS. I can see pros and cons either way. I take it that the

Array.prototype.search

2012-05-25 Thread Rich Walrath
Hello, I've been playing around with an iterative array method I wrote earlier today. I thought it would be a good idea to post it here and see wher The idea behind this method is to search for the best match. It does this by allowing you to specify a weighing function that calculates the best