Saturday, March 22, 2008

Joose can write TPS-Reports

While advancing at least two computer science zen levels I augmented my brain enough to implement the augment method modifier in Joose.

Class("HTMLDoc", {
augment: {
html: function () { return "<html>"+this.INNER()+"</html>" }
}
})

Class("HTMLDocBody", {
isa: HTMLDoc,
augment: {
html: function () { return "<body>"+this.INNER()+"</body>" }
}
})

Class("TPSReport", {
isa: HTMLDocBody,
augment: {
html: function () { return "<h1>TPS-Report</h1>" }
}
})

While making method modifiers stackable was really easy for all the other modifiers, I had to roll my own reverse call stack to make it happen with augment.
Post a Comment