in reply to Any framework for bulk operations?

There is no way to predict how many (or which) other objects you will be calling ->op2() on, when you call report_row() on the first of them. Or the last for that matter.

However, if you wrap up your collection (array) of objects in a class, then you can provide a ->report_rows() method that knows how many (and which) objects you intend to process and so it can aggregate the individual steps if that makes sense. Of course, when I say "it can aggregate", that really means "you can aggregate" when you write that method. (Of course, you could write report_rows() as a function equally well.)

There isn't, and probably could not be, any mechanism that could analyse your report_row() function and automatically generate a report_rows() function from it.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."