function(/*a...,*/ b, c) {
var a, _numArgs;
_numArgs = arguments.length;
a = [];
if(_numArgs > 2) {
a = __slice.call(arguments, 0, _numArgs - 2);
b = arguments[_numArgs - 2];
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default: all | |
# configure these: | |
LIBDIR = lib | |
SRCDIR = src | |
TESTDIR = test | |
BROWSERIFIED = ProjectName.js | |
MAIN = $(LIBDIR)/project-main-entry-point.js | |
ROOT = $(shell pwd) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Q = require './q' | |
class exports.Task | |
constructor: (@promise) -> | |
value: null | |
reason: null | |
result: -> | |
unless @promise.isResolved() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
flip = (fn) -> (a, b) -> fn b, a | |
id = (x) -> x | |
class exports.Future | |
constructor: (fn) -> | |
(flip setTimeout) 0, => | |
try | |
@result = fn() | |
catch e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Applicative ((<*>)) | |
import Control.Parallel (par) | |
class Comonad w where | |
extend :: (w a -> b) -> w a -> w b | |
duplicate :: w a -> w (w a) | |
extract :: w a -> a | |
-- if monads are monoids on functions which produce side effects, | |
-- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ make && (for file in src/*.coffee; do echo -n "$file: "; bin/coffee --js <"$file" >/dev/null && echo '*success*'; done) | |
make: Nothing to be done for `default'. | |
src/command.coffee: *success* | |
src/compiler.coffee: *success* | |
src/functional-helpers.coffee: *success* | |
src/helpers.coffee: *success* | |
src/js-nodes.coffee: *success* | |
src/module.coffee: *success* | |
src/nodes.coffee: *success* | |
src/optimiser.coffee: *success* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fs = require 'fs' | |
{EventEmitter} = require 'events' | |
StringScanner = require 'cjs-string-scanner' | |
inspect = (o) -> (require 'util').inspect o, no, 9e9, yes | |
# TODO: better comments | |
# TODO: support win32-style line endings |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Assuming ES5 builtins, create an inclusive range of numbers between an arbitrary, integral `a` and `b` | |
Array(Math.abs(a - b) + 1).join('|').split('|').map(function(){ var i = a; return a < b ? function(){ return i++; } : function(){ return i--; }; }()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Error: Syntax error on line 86, column 7: unexpected ',' | |
83 : test 'dedented comma style', -> | |
84 : eq 3, [ | |
85 : 0 | |
86 : , | |
^^ :~~~~~~~^ | |
87 : 0 | |
88 : , | |
89 : 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generated by CoffeeScript 2.0.0 | |
void function () { | |
var EventEmitter, fs, inspect, Preprocessor, StringScanner; | |
fs = require('fs'); | |
EventEmitter = require('events').EventEmitter; | |
StringScanner = require('cjs-string-scanner'); | |
inspect = function (o) { | |
return require('util').inspect(o, false, 9e9, true); | |
}; | |
this.Preprocessor = Preprocessor = function (super$) { |