Μπορώ να κάνω κάτι παρόμοιο με CoffeeScript ή Ruby, όπου μπορώ να δημιουργήσω ταξικές «Μακροεντολές»
class A
# events adds the class method listenTo to the class (not to the prototype)
# listenTo will make all instances of A a listener to the given Event
events @
# this will register instances of A to listen for SomeEvents
# the event broker (not here in this code) will specifically look
# for a method called onSomeEvent(event)
@listenTo SomeEvent
# and then later
onSomeEvent: (event)-> #do what ever is needed
Αυτό θα δημιουργήσει τον ακόλουθο κώδικα Javascript
var A;
A = (function() {
function A() {}
events(A);
A.listenTo(SomeEvent);
A.prototype.onSomeEvent = function(event) {};
return A;
})();













