This would work: http://gist.github.com/536715
I'm not sure wether this is good style. Probably not.
Edit: Bah. Fixed an error.
I'm not sure wether this is good style. Probably not.
Edit: Bah. Fixed an error.
Sadly, as far as I know, you need to roll your own tree-reduce.