And then there is this whole other category of self-modifying programs - programs that know about their own structure and can change themselves at runtime. This is (almost) in the "unthinkable" category for non-homoiconic languages.
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?