I'm not sure I understand what you have in mind. Assuming I have something like this:
int foo(void)
{
return bar(1) + 2;
}
is there any way in which I could arbitrarily modify this function? E.g. to dynamically turn it into
int foo(void)
{
return bar(2) * 4
}
using closures?
I get how you could do that, assuming you had a function defined for each of the possible operations you needed. But what about arbitrary modifications?