Re: Strawman proposal: new `is` operator

2014-08-25 Thread Brendan Eich
Isiah Meadows wrote: Cc the list... On Aug 25, 2014 6:06 PM, "Isiah Meadows" > wrote: There really shouldn't be any sort of object construction needed to check types like this. `isa` may be better, anyways, but I still find that requirement to build and

Re: Questions regarding ES6 Unicode regular expressions

2014-08-25 Thread Norbert Lindenberg
On Aug 25, 2014, at 1:59 , Mathias Bynens wrote: > Norbert’s original proposal for the `u` flag > (http://norbertlindenberg.com/2012/05/ecmascript-supplementary-characters/#RegExp) > mentioned the following: > >> Possibly the definition of the character classes `\d\D\w\W\b\B` is extended >>

Re: Strawman proposal: new `is` operator

2014-08-25 Thread Isiah Meadows
Cc the list... On Aug 25, 2014 6:06 PM, "Isiah Meadows" wrote: > There really shouldn't be any sort of object construction needed to check > types like this. `isa` may be better, anyways, but I still find that > requirement to build and destroy an object to check somewhat > counterproductive. > >

Re: Bundling vs sending serialized dependency graph

2014-08-25 Thread Ian Hickson
On Fri, 22 Aug 2014, Marius Gundersen wrote: > > > > One way to do this would be to predeclare the modules, as in: > > > > > > > > > > > > > > > > All of these scripts would need to be empedded in every page Only the ones that are needed. But actually it's not that bad. Th

Re: let in loops

2014-08-25 Thread Rick Waldron
On Mon, Aug 25, 2014 at 6:16 AM, Salvador de la Puente González < sa...@unoyunodiez.com> wrote: > Does it only work for `for` loops, > No or it is the same for any block? > Yes, let and const are block-scoped. Rick > > On Mon, Aug 25, 2014 at 11:46 AM, Andrea Giammarchi < > andrea.giammar..

Rev27 ES6 draft now available

2014-08-25 Thread Allen Wirfs-Brock
At: http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts#august_24_2014_draft_rev_27 Fixed scoping bug in for-of, catch clause, comprehensions WRT TDZ for iteration bindings. see bug: https://bugs.ecmascript.org/show_bug.cgi?id=3011 For-in/for-of loop bodies can’t contain tail c

Re: Proposal: generator#clone() and generator#goto()

2014-08-25 Thread John Lenz
On Mon, Aug 25, 2014 at 2:17 AM, Salvador de la Puente González < sa...@unoyunodiez.com> wrote: > Sorry, I sent this only to Tab. > > On 20 Aug 2014 17:39, "Tab Atkins Jr." wrote: > > > > > On Wed, Aug 20, 2014 at 5:00 AM, Salvador de la Puente González > > wrote: > > > Hello. > > > > > > Just a

Re: Fixing the associativity / precedence of the instanceof operator

2014-08-25 Thread Till Schneidereit
On Mon, Aug 25, 2014 at 1:01 PM, Charles Pick wrote: > I agree that this could cause some problems, however, that code has never > been correct in the first place. It's the equivalent of writing `if (false) > {...}`. Seems like it's reasonable to fix something if it only has an > impact on code w

Re: Fixing the associativity / precedence of the instanceof operator

2014-08-25 Thread Salvador de la Puente González
Before doing that, I would propose to introduce `not`, `and` and `or` with fixed associativity or even a `notinstanceof` for that case before changing the semantics of ! operator. Indeed I think `!object instance of class` is less readable than !(object instanceof class). On Mon, Aug 25, 2014 at

Re: Fixing the associativity / precedence of the instanceof operator

2014-08-25 Thread Charles Pick
I agree that this could cause some problems, however, that code has never been correct in the first place. It's the equivalent of writing `if (false) {...}`. Seems like it's reasonable to fix something if it only has an impact on code which is already broken. On Mon, Aug 25, 2014 at 11:56 AM, Til

Re: Fixing the associativity / precedence of the instanceof operator

2014-08-25 Thread Till Schneidereit
On Mon, Aug 25, 2014 at 12:40 PM, Charles Pick wrote: > Hello, forgive me if this has come up before, I couldn't find any > discussions via Google. > > One regular, annoying mistake I see people making is combining the `!` > operator with `instanceof`: > > if (!foo instanceof Foo) { ... } > >

Fixing the associativity / precedence of the instanceof operator

2014-08-25 Thread Charles Pick
Hello, forgive me if this has come up before, I couldn't find any discussions via Google. One regular, annoying mistake I see people making is combining the `!` operator with `instanceof`: if (!foo instanceof Foo) { ... } of course, this must be written with extra parentheses: if (!(fo

Re: Binding arrow functions.

2014-08-25 Thread Mark Everitt
I got my lack-of-sleep addled head around this by realising that an arrow function performs like an immediately bound function expression: ```js var test = (function (){ // Do stuff with this... }).bind(this); ``` i.e. Domenic's second example function. Then it was obvious that arrow function

Re: let in loops

2014-08-25 Thread Salvador de la Puente González
Does it only work for `for` loops, or it is the same for any block? On Mon, Aug 25, 2014 at 11:46 AM, Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > That is an intended behavior, you can see that `let` loop in this way, > metaphorically speaking: > > ```js > function test() { > for

Re: Binding arrow functions.

2014-08-25 Thread Till Schneidereit
On Mon, Aug 25, 2014 at 4:30 AM, Boris Zbarsky wrote: > On 8/24/14, 10:26 PM, Mark Everitt wrote: > >> The problem remains that arrow functions make >> bind etc. unpredictable. >> > > I think part of Domenic's point is that return values of bind() also make > bind (and call/apply for that matter)

Re: Questions regarding ES6 Unicode regular expressions

2014-08-25 Thread Anne van Kesteren
On Mon, Aug 25, 2014 at 11:44 AM, Till Schneidereit wrote: > (Forwarding to Norbert as I don't know how closely he follows es-discuss.) I think last year somewhere regular expression extensions were postponed because nobody was interested in working out detailed proposals. As far as I can tell th

Re: let in loops

2014-08-25 Thread Andrea Giammarchi
That is an intended behavior, you can see that `let` loop in this way, metaphorically speaking: ```js function test() { for (var i=0; i<10; i++) { (function(i){ setTimeout(() => console.log(i)); }.call(this, i)); } } ``` except after the loop no variable `i` with last loop value

Fwd: Questions regarding ES6 Unicode regular expressions

2014-08-25 Thread Till Schneidereit
(Forwarding to Norbert as I don't know how closely he follows es-discuss.) -- Forwarded message -- From: Mathias Bynens Date: Mon, Aug 25, 2014 at 10:59 AM Subject: Questions regarding ES6 Unicode regular expressions To: es-discuss Norbert’s original proposal for the `u` flag (

let in loops

2014-08-25 Thread Salvador de la Puente González
Hello, recently I read about `let` inside for loops. According to https://leanpub.com/understandinges6/read#leanpub-auto-block-bindings `let` allows the developer to make: ```js function test() { for (let i=0; i<10; i++) { setTimeout(() => console.log(i)); } } ``` And this will print 0,

RE: Proposal: generator#clone() and generator#goto()

2014-08-25 Thread Salvador de la Puente González
Sorry, I sent this only to Tab. On 20 Aug 2014 17:39, "Tab Atkins Jr." wrote: > > On Wed, Aug 20, 2014 at 5:00 AM, Salvador de la Puente González > wrote: > > Hello. > > > > Just a little presentation before the proposal. I'm Salvador de la Puente > > González (you can call me Salva, please). I

Re: Strawman proposal: new `is` operator

2014-08-25 Thread Andrea Giammarchi
I know it's just a sketch but that `Object.prototype.is` does not play well with `Object.create` where no constructor is necessary to create `is` relations. Regards On Sun, Aug 24, 2014 at 10:15 PM, C. Scott Ananian wrote: > On Sun, Aug 24, 2014 at 4:04 PM, Isiah Meadows > wrote: > > There is

Questions regarding ES6 Unicode regular expressions

2014-08-25 Thread Mathias Bynens
Norbert’s original proposal for the `u` flag (http://norbertlindenberg.com/2012/05/ecmascript-supplementary-characters/#RegExp) mentioned the following: > Possibly the definition of the character classes `\d\D\w\W\b\B` is extended > to their Unicode extensions, such as all characters in the Uni

Re: Strawman proposal: new `is` operator

2014-08-25 Thread Florian Bösch
Python, Coffeescript and VB use the "is" operator for object identity, not for instanceof like functionality. Dart uses the is operator analogous to instanceof. It would seem to me it'd be beneficial to pick a different operator name, in order to avoid the fuddled meaning this operator has taken to