3 ms·
The article is about having the correct environment set up - attacking the problem from the environment level. When I think of "hacking code you didn't write"
by pizza 4y ago
The article is about having the correct environment set up - attacking the problem from the environment level.
When I think of "hacking code you didn't write" one of the biggest hurdles for me is "inserting my changes to the behavior of the code with minimal refactoring of the original" - attacking the problem from, perhaps, compiler instrumentation level.
e.g. suppose when I use some library function f, there is a deeply nested function, g, that has access to some data x, which is cleaned up somewhere before the API returns its result.
How do I tell my compiler "I want a new function h, which, when given the same arguments as f, returns x, by returning from within g" ?
- LanternLight83 4y agoThis problem is trivial within emacs thanks to the advice system, and something I've always missed in literally any other programming environment. In Guile, I bet `(parameterize)` could be used to similar ends, but you don't get to choose the language of every project you hack on.