(function() {
  '#Mixins\n\nclass Mixin1\n    @staticProp   = 42\n    dymamicMethod : -> "Mixin1 : #{@name}"\n\nclass Mixin2\n    dynamicMethod : -> "Mixin2 : #{@name}"\n\nclass ExampleClass extends AnotherClass\n    @implements Mixin1, Mixin2\n    constructor : (@name) ->\n\nobj = new ExampleClass \'Tim\'\n\nExampleClass.staticProp is 42\nobj.dynamicMethod() is \'Mixin2 : Tim\'';
  var implements;
  var __slice = Array.prototype.slice;
  implements = function() {
    var classes, getter, klass, prop, setter, _i, _len;
    classes = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
    for (_i = 0, _len = classes.length; _i < _len; _i++) {
      klass = classes[_i];
      for (prop in klass) {
        this[prop] = klass[prop];
      }
      for (prop in klass.prototype) {
        getter = klass.prototype.__lookupGetter__(prop);
        setter = klass.prototype.__lookupSetter__(prop);
        if (getter || setter) {
          if (getter) {
            this.prototype.__defineGetter__(prop, getter);
          }
          if (setter) {
            this.prototype.__defineSetter__(prop, setter);
          }
        } else {
          this.prototype[prop] = klass.prototype[prop];
        }
      }
    }
    return this;
  };
  if (Object.defineProperty) {
    Object.defineProperty(Function.prototype, "implements", {
      value: implements
    });
  } else {
    Function.prototype.implements = implements;
  }
  '#Modules \n\n@module "foo.bar", ->\n  class @Amazing\n    toString: "ain\'t it"\n\nx = new foo.bar.Amazing';
  this.module = function(names, fn) {
    var space, _name;
    if (typeof names === 'string') {
      names = names.split('.');
    }
    space = this[_name = names.shift()] || (this[_name] = {});
    space.module || (space.module = this.module);
    if (names.length) {
      return space.module(names, fn);
    } else {
      return fn.call(space);
    }
  };
  '#Sequential execution\n\nexec = () -> Next {foo: \'bar\'},\n    (err, result, next) ->\n        console.log \'first\', arguments\n        return next err if err\n        throw \'Catch me1!\'\n        next \'err1\', \'res1\'\n    (err, result, next) ->\n        console.log \'second\', arguments\n        return next err if err\n        next \'err2\', \'res2\'\n    (err, result, next) ->\n        console.log \'third\', arguments\n        return next err if err\n        next \'err3\', \'res3\'\n\ntry\n    exec()\ncatch err\n    console.log \'CAUGHT\', err';
}).call(this);

