Ben sınıf- Makrolar oluşturabilir CoffeeScript veya Ruby benzer bir şey yapabilir
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
Bu aşağıdaki JavaScript kodu yaratacak
var A;
A = (function() {
function A() {}
events(A);
A.listenTo(SomeEvent);
A.prototype.onSomeEvent = function(event) {};
return A;
})();













