Re: AND and OR in if statement

2016-05-24 Thread kdex
Could you explain how your second example is cleaner? All I see is that it's longer; the rest is merely a matter of taste. JavaScript's syntax was, amongst others, heavily influenced by C-family languages (which went for `&&` and `||` as well as `&` and `|`). Next, I think it's confusing that,

Re: AND and OR in if statement

2016-05-24 Thread Jonathan Barronville
No, please don't do this. While I understand why you want this, I feel like this is unnecessary and will just introduce yet another way to write inconsistent and confusing JavaScript code . \- Jonathan — Life is a game and we’re all just high density pixels. On May 24 2016, at

AND and OR in if statement

2016-05-24 Thread Francis Clavette
Hi, I’d like to be able to use AND for && and OR for || in conditional statements in a future version of ECMAScript. It’s a feature I’ve always been wanting since transitioning from PHP. It’s also much cleaner : if ($scope.newSourceModal.isShown() && $scope.newsource.type == "book" &&

Re: Existential Operator / Null Propagation Operator

2016-05-24 Thread Brendan Eich
You need to be very careful hacking around in an ad-hoc parser. It's easy to diverge from the formal (and verified) grammar by accident. Ambiguous grammars with ad-hoc disambiguation rules codified only by your parser's source code are bad business. Voice of experience here. /be On Sat, May 21,

Proposal: importing selected chucks of a module into an object

2016-05-24 Thread Norbert de Langen
# importing selected chucks of a module into an object Modules are always imported into the root scope of the imported file. But in some cases it can be desirable to load modules into a namespace-object. Especially when importing a large number of parts/chunks from a module creating a

Re: Proposal: importing selected chucks of a module into an object

2016-05-24 Thread Tab Atkins Jr.
On Tue, May 24, 2016 at 11:59 AM, Norbert de Langen wrote: > It would be nice to have this option: > > ``` > import { parse } as xmlLib from 'xml-lib'; > import { parse } as jsonLib from 'json-lib'; > import { parse } as htmlLib from 'html-lib'; > > // usage >

Re: Proposal: importing selected chucks of a module into an object

2016-05-24 Thread Jordan Harband
This is usually part of the reason why small modules are recommended, rather than large object bags of things (including many named exports). Have you considered putting each thing you want to import as the default export of a separate file? On Tue, May 24, 2016 at 9:20 PM, Norbert de Langen <

Re: Proposal: importing selected chucks of a module into an object

2016-05-24 Thread Norbert de Langen
I think there’s a preference reason for this but also optimization reasons. For humans it becomes crystal clear exactly what parts are dependent on. I personally like this. When importing the entire module the module code needs to be run to figure out what parts are not needed. Eliminating the