express = require 'express'
app = express()
port = process.env.PORT or 5000
exports = module.exports = (callback) ->
app.listen port, callback
engine = require './engine'
app = engine ->
console.log "listening on " + app.address().port
var obj = (function () {
var _alpha;
function alpha(value) {
// общая для синонимов функция get/set
if (arguments.length) {
_alpha = value;
}
else {
return _alpha;
}
}
return {
// "public", объявление синонимов
alpha: alpha,
opacity: alpha
}
}());
obj.alpha(.5);
console.log(obj.alpha()); // 0.5
console.log(obj.opacity()); // 0.5
obj.opacity(.75);
console.log(obj.alpha()); // 0.75
console.log(obj.opacity()); // 0.75