3 ms·
This is not a monkeypatching problem, per se. It is a problem of scope-independent class definition. There are languages wherin you can monkeypatch the class de
by aaronblohowiak 18y ago
This is not a monkeypatching problem, per se. It is a problem of scope-independent class definition. There are languages wherin you can monkeypatch the class definition (or the definition of a single instantiation of a class) wherin those patches only are in effect in certain contexts.. so you have a scope to your monkeypatching. I think that this would allow for Interesting Things, while being "safe".
- catch23 18y agoSometimes monkey patching is good actually. I use Soap4r all the time, and I preferred the debug xml to appear in the console rather than created as a separate file, it was really easy to make a monkey patch that fixed this, without modifying the actual distribution... that way other projects wouldn't be affected. Another time, there was a small bug in Hpricot, rather than fix it directly in source, I patched it in my code, and removed the patch when the fix was in the production stream. At least it's nice to have that option available...