From: Robert Dober Date: 2009-05-31T07:24:42+09:00 Subject: Re: monkeypatch-0.1.2 (alpha) On Fri, May 29, 2009 at 5:59 PM, Daniel DeLorme wrote: > trans wrote: >> >> Besides the issues you mention (new API and adoption), I see other >> reasons something like this isn't going to make much headway. >> >> 1. You can use -w ruby option to get warnings about methods that are >> redefined. >> >> 2. Raising an error on a method redefinition is too much. There are >> times when that's what you need to do, say to temporary patch a bug. > > Really? Raising an error is too much? Consider that if you get this warning, > what it really means is that you just clobbered someone else's method and > their code will most definitely fail because of this. If this isn't the time > for "fail fast" then I don't know what is. Clobbering a method (for example > to patch a bug) should be the exception case; then you could easily undef > the method before defining your patched version. And actually that should be the only way to redefine a method, I was really greatful when someone pointed out the warnings I produced in my code. In Runy1.9 it can be a little bit teadious to remove the method before redefining it, or is there a better way than remove_method ? I would love to have a define_method! method which does all the internals for me. Just my microbucks. Cheers Robert > > Daniel > > -- Toutes les grandes personnes ont d’abord été des enfants, mais peu d’entre elles s’en souviennent. All adults have been children first, but not many remember. [Antoine de Saint-Exupéry]