News for hackers. Stuff that matters.
Re:ToffeeScript – CoffeeScript with async syntax and some ad... by Kiro on Saturday October 26, 2013 @10:09AM (#6617432)
I don't understand what the Basic example is supposed to do:

var x, y, _this = this;

a(b, function() { x = arguments[0], y = arguments[1]; return console.log(x, y); }); ReferenceError: a is not defined

Re:ToffeeScript – CoffeeScript with async syntax and some ad... by michaelmior on Saturday October 26, 2013 @10:24AM (#6617480)
a is a function which would already be defined at this point. Anything after the exclamation point is arguments to the callback function. Any following code is wrapped in an anonymous function passed as the final argument to the function a.

Anything on the left-hand side of the assignment (in this case, x and y) are arguments passed to this anonymous function. A concrete example of why you would do this would probably be useful.

Re:ToffeeScript – CoffeeScript with async syntax and some ad... by michaelmior on Saturday October 26, 2013 @10:28AM (#6617491)
Here's a somewhat contrived example which I haven't tested, but I think illustrates the point although this particular case is probably better handled by other syntax presented later in the README.

err, data = fs.readFile! path

{

  if (err) throw err;

  console.log data

}