Travis demonstrates - in 4 lines - how to create anonymous objects - instances of a new anonymous class that is like an existing class, except that you can inject instance specific behavior into it. So say you wanted to have a custom XML parser that handled a specific kind of error, but you didn't want to create a whole subclass, and you didn't want to change the behavior of the stock parser....
And yes, as Randal mentions, this is one of the things that makes Smalltalk cool :)
Technorati Tags:
reflection