Re: Pseudo headless arrows

2016-04-22 Thread Joris van der Wel
Yes, that is still how mocha does things. Mocha is not the best example though, because it is not compatible with arrow functions. Mocha uses `this` to expose extra functions to your test case. (I always use a wrapper around mocha to avoid these issues) Subject: Re: Pseudo headless arrows > @J

Re: Pseudo headless arrows

2016-04-22 Thread /#!/JoePea
I like that Headless Arrow Function proposal (http://bterlson.github.io/headless-arrows). ```js doSomethingAsync(=> console.log('done')) ``` On Thu, Apr 21, 2016 at 5:02 PM, Michael Theriot wrote: > Three equals used outside of strict equality might take some

Re: Pseudo headless arrows

2016-04-21 Thread Michael Theriot
Three equals used outside of strict equality might take some getting used to `var fn ===> x` On Thu, Apr 21, 2016 at 1:48 PM, Peter van der Zee wrote: > > > There are two ways of writing argument-less arrows; > > () => x; > _ => x; > > (Where `_` can be any identifier, of

Re: Pseudo headless arrows

2016-04-21 Thread Fabrício Matté
@John: Good point. IIRC, Mocha was (is?) one of such test frameworks that inspect the function's `length` property in order to determine whether the author intends the test to be run asynchronously (i.e. the first argument receives a function that must be called when the test is done). Whether

Re: Pseudo headless arrows

2016-04-21 Thread John Lenz
_=>{} is a function that takes one param and is not equivalent to ()=>{}. Some test frameworks inspect the function and care about the difference. On Apr 21, 2016 3:34 PM, "Fabrício Matté" wrote: The `==>` token would look like a new operator, which developers would have to

Re: Pseudo headless arrows

2016-04-21 Thread Fabrício Matté
The `==>` token would look like a new operator, which developers would have to look up in order to know exactly what it does. It is more confusing than helpful, IMHO. Also `==>x` has the same length as `_=>x`, the latter not introducing any new syntax (although it does employ an ugly unused

Pseudo headless arrows

2016-04-21 Thread Peter van der Zee
There are two ways of writing argument-less arrows; () => x; _ => x; (Where `_` can be any identifier, of course.) I understand why we can't drop the head entirely so if we're forced to type anything at all, anyways, why not at least make it simpler by pressing two different keys instead of