2 ms·
All of my serious objections to monkeypatching go away if you can scope them. Then I'm just left with a general "that's icky" feeling that I wouldn't press on
by jerf 18y ago
All of my serious objections to monkeypatching go away if you can scope them.
Then I'm just left with a general "that's icky" feeling that I wouldn't press on anyone.
Raganwald, have you ever used Perl's "local" keyword? It's really similar to what you're looking for; "in this scope and anything I call, the value of the thing identified by $x is now this; when this scope expires, it goes back to what it was before". For what you're looking for, you'd want to drop the "and anything I call" bit, but it's doable.
And I agree that you would also go along ways towards solving this sort of dependency problem.