Boolean shortcuts

François REMY fremycompany_pub at yahoo.fr
Wed Jan 4 15:23:08 PST 2012


Is breaking current code so much of a problem? If, by default, javascript 
refers to "ES5" and if we introduce a "use version 6" pragma, breaking old 
code isn't a problem anymore. Scripting languages on UNIX are doing exactly 
this [http://en.wikipedia.org/wiki/Shebang_(Unix)]. The first line indicate 
the compiler/interpretor to use. That way you will never break the web, but 
you allow ECMAScript to move forward. We really need this.

That doesn't mean we have to start over a new language but if, to make the 
language better, we have to make some changes that will have a minor impact 
on existing code (seriously, who is using code blocks at all?), this should 
not be a blocking issue. The comitee removed the with functionnality in ES5 
strict. That wasn't a problem. People can still use their old code and can 
opt-in for a new version with stricter rules.

For people wanting to convert old code to ES6, there will be automated tools 
that can predict reliably if your code continues to work under ES6 and can 
notice you of problems. If those are rare engouh, most of our code will 
continue to run.



-----Message d'origine----- 
From: Brendan Eich
Sent: Thursday, January 05, 2012 12:03 AM
To: es-discuss
Subject: Re: Boolean shortcuts

On Jan 4, 2012, at 2:56 PM, Brendan Eich wrote:

> On Jan 4, 2012, at 1:57 PM, Herby Vojčík wrote:
>
>> Hi,
>>
>> as I already posted in the parallel thread, there is that strawman called 
>> "do expression" by dherman that does just that.
>>
>> I feel like crying when I see how powerful data constructs could be if 
>> not hampered by "possible to parse as code block" ambiguity.
>
> Yes, I have felt like crying too -- I did some work (see 
> https://mail.mozilla.org/pipermail/es-discuss/2011-June/015568.html)

I should have also linked:

http://wiki.ecmascript.org/doku.php?id=strawman:block_vs_object_literal

Of course,

http://wiki.ecmascript.org/doku.php?id=strawman:do_expressions

is much simpler.

Neither addresses the empty-block/object issue by trying to evaluate {} as 
an object literal where today it's a block statement.

/be

_______________________________________________
es-discuss mailing list
es-discuss at mozilla.org
https://mail.mozilla.org/listinfo/es-discuss 



More information about the es-discuss mailing list