Re:Turn any application that uses stdin/stdout into a WebSoc...
by thomasahle on Tuesday December 10, 2013 @06:12AM
(#6880065)
A nice example on Node. Only I don't quote get the ',' syntax. Is it a scoping thing?
[ Parent
| on HN ]
Re:Turn any application that uses stdin/stdout into a WebSoc...
by jbrooksuk on Tuesday December 10, 2013 @06:17AM
(#6880076)
It's a Coffee syntax thing.
ws.on 'close', -> ps.kill()
That compiles to: ws.on('close', function() {
return ps.kill();
});
Re:Turn any application that uses stdin/stdout into a WebSoc...
by thu on Tuesday December 10, 2013 @11:45AM
(#6881724)
I have never done any Coffee but it looks like arguments are separated by commas, and, in this case, the second argument is a function of no argument (so the left hand side of the arrow is empty).
Edit: it was meant to be a reply to the parent.