Re: let and strict mode

2012-11-18 Thread Kevin Smith
Dave Herman proposed as part of 1JS that module imply strict mode, so let is reserved in module. So that helps. Sure, for inline modules. But are externally loaded modules strict as well? I think they should be... 1. 'let' only in strict code including modules per 1JS as originally proposed

Re: let and strict mode

2012-11-18 Thread Yehuda Katz
...@gmail.com wrote: Dave Herman proposed as part of 1JS that module imply strict mode, so let is reserved in module. So that helps. Sure, for inline modules. But are externally loaded modules strict as well? I think they should be... 1. 'let' only in strict code including modules per 1JS

Re: let and strict mode

2012-11-18 Thread Allen Wirfs-Brock
On Nov 17, 2012, at 7:25 PM, Brendan Eich wrote: 5. We could also allow 'let' per (4) in functions not in modules that do not use strict but do use new ES6 syntax in their heads, e.g. destructuring parameters, default parameters, rest parameters. Those head features could

Re: let and strict mode

2012-11-18 Thread Brendan Eich
Yehuda Katz wrote: Question: does requiring strict mode for changes that break compatibility with ES5 really address the 1JS concerns? Yes. 1JS is based on ES5 and so includes strict mode. We're making usages of the identifier let that were valid in ES5 strict invalid in ES6 strict. Doesn't

Re: let and strict mode

2012-11-18 Thread Yehuda Katz
-- Yehuda Katz (ph) 718.877.1325 On Nov 18, 2012 4:29 PM, Brendan Eich bren...@mozilla.com wrote: Yehuda Katz wrote: Question: does requiring strict mode for changes that break compatibility with ES5 really address the 1JS concerns? Yes. 1JS is based on ES5 and so includes strict mode. I

Re: let and strict mode

2012-11-17 Thread Brendan Eich
Dave Herman proposed as part of 1JS that module imply strict mode, so let is reserved in module. So that helps. For let outside of modules, we could contextually parse let at start of statement if followed by an identifier or a { that starts an object pattern. We could even allow

Re: let and strict mode

2012-11-17 Thread Yehuda Katz
On Sat, Nov 17, 2012 at 6:06 PM, Brendan Eich bren...@mozilla.com wrote: Dave Herman proposed as part of 1JS that module imply strict mode, so let is reserved in module. So that helps. For let outside of modules, we could contextually parse let at start of statement if followed

Re: let and strict mode

2012-11-17 Thread Brendan Eich
Yehuda Katz wrote: On Sat, Nov 17, 2012 at 6:06 PM, Brendan Eich bren...@mozilla.com mailto:bren...@mozilla.com wrote: Dave Herman proposed as part of 1JS that module imply strict mode, so let is reserved in module. So that helps. For let outside of modules, we could contextually

RE: let and strict mode

2012-11-17 Thread Domenic Denicola
: Sunday, November 18, 2012 04:25 To: Yehuda Katz Cc: es-discuss Subject: Re: let and strict mode Yehuda Katz wrote: On Sat, Nov 17, 2012 at 6:06 PM, Brendan Eich bren...@mozilla.com mailto:bren...@mozilla.com wrote: Dave Herman proposed as part of 1JS that module imply strict mode, so

Re: let and strict mode

2012-11-16 Thread Kevin Smith
Another experiment would tell us more...and as Peter points out, there are people who like to put their declarator keyword on a separate line. Mmm... I think a [no LineTerm] restriction is going to bite too hard in this case. If let in non-strict mode were a context-sensitive keyword

Re: let and strict mode

2012-11-16 Thread Kevin Smith
would be to only allow let in strict mode. A carrot (or stick, depending on your point of view) to get users into strict? - Kevin ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: let and strict mode

2012-11-16 Thread Herby Vojčík
Kevin Smith wrote: var let = [], num = 0; let[num] = f(); Awww, that's hard. I am really curious how this one is solved. - Kevin Herby ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: let and strict mode

2012-11-16 Thread Yehuda Katz
Doesn't the same problem exist with: var let = function() {}; let(); Or: var let = { it: be }; let.it // be On Fri, Nov 16, 2012 at 9:19 AM, Herby Vojčík he...@mailbox.sk wrote: Kevin Smith wrote: var let = [], num = 0; let[num] = f(); Awww, that's hard. I

Re: let and strict mode

2012-11-16 Thread Herby Vojčík
Yehuda Katz wrote: Doesn't the same problem exist with: var let = function() {}; let(); Or: var let = { it: be }; let.it http://let.it // be These seem to be parseable better (especially the latter), but how to distiguish if let [foo] = bar is let with destructuring

Re: let and strict mode

2012-11-16 Thread Kevin Smith
var let = function() {}; let(); If let is a contextual keyword (in non-strict mode of course), then we can look ahead to the token after `let` to validate it. An open paren cannot follow a let *keyword*, so therefore it must be an identifier. var let = { it: be }; let.it //

Re: let and strict mode

2012-11-15 Thread Allen Wirfs-Brock
On Nov 15, 2012, at 11:33 AM, Kevin Smith wrote: I'm not quite sure how to figure this out from the current draft, but is let only available from strict mode code? This is valid under ES5 non-strict via ASI: No, it is currently spec'ed as a reserved keyword in both regular and strict

Re: let and strict mode

2012-11-15 Thread Erik Arvidsson
On Thu, Nov 15, 2012 at 2:49 PM, Allen Wirfs-Brock al...@wirfs-brock.comwrote: This is what TC39 agreed to try when we started down the 1JS path, with the expectation that implementation would explore the compatibility impact. JSC tried making let a keyword and it broke things, forcing them

Re: let and strict mode

2012-11-15 Thread Brendan Eich
Of course, 'let' short for 'letter' :-|. Contextual keyword with [no LineTerminator here] after sounds like the plan. I'm curious whether you have already implemented this in Traceur? /be Erik Arvidsson wrote: On Thu, Nov 15, 2012 at 2:49 PM, Allen Wirfs-Brock al...@wirfs-brock.com

Re: let and strict mode

2012-11-15 Thread Allen Wirfs-Brock
On Nov 15, 2012, at 4:17 PM, Brendan Eich wrote: Of course, 'let' short for 'letter' :-|. Contextual keyword with [no LineTerminator here] after sounds like the plan. I'm curious whether you have already implemented this in Traceur? /be I wonder if the [no LineTerminator here] is

Re: let and strict mode

2012-11-15 Thread Peter van der Zee
On Fri, Nov 16, 2012 at 1:35 AM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Nov 15, 2012, at 4:17 PM, Brendan Eich wrote: Of course, 'let' short for 'letter' :-|. Contextual keyword with [no LineTerminator here] after sounds like the plan. I'm curious whether you have already

Re: let and strict mode

2012-11-15 Thread Brendan Eich
Allen Wirfs-Brock wrote: On Nov 15, 2012, at 4:17 PM, Brendan Eich wrote: Of course, 'let' short for 'letter' :-|. Contextual keyword with [no LineTerminator here] after sounds like the plan. I'm curious whether you have already implemented this in Traceur? /be I wonder if the [no

Re: let and strict mode

2012-11-15 Thread Allen Wirfs-Brock
On Nov 15, 2012, at 4:44 PM, Brendan Eich wrote: Allen Wirfs-Brock wrote: On Nov 15, 2012, at 4:17 PM, Brendan Eich wrote: Of course, 'let' short for 'letter' :-|. Contextual keyword with [no LineTerminator here] after sounds like the plan. I'm curious whether you have already