4 comments

[ 2.6 ms ] story [ 17.4 ms ] thread
Seems like something you could do with decorators in python, but would probably end up looking more confusing than the original.
If you are using Ruby you might be able to use some variation of the "around alias" mentioned here:

http://media.pragprog.com/titles/ppmetr/spells.pdf

Maybe even create your own little dsl for your approach.

I love that it's under a section called "spells". And actually it looks like it could be done with a variation of this.

This is why I love Ruby. It goes out of its way to let programmers be creative :)