From: "zimbatm ..." Date: 2009-06-10T06:09:30+09:00 Subject: Re: monkeypatch-0.1.2 (alpha) Thomas Sawyer wrote: > Besides the issues you mention (new API and adoption), I see other > reasons something like this isn't going to make much headway. The next version will support a better conflict detection engine that should make it robust enough to be useful even with zero adoption. > 1. You can use -w ruby option to get warnings about methods that are > redefined. This is not the same. It will also catch method redefinitions inside your project. Monkeypatch is for external code (core, stdlib and vendor) patching. > 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. Discussed earlier. But to be precide, the idea is to add a non-raising condition that will detect if the bug still exists before applying the patch. > 3. Using a standardized extension library like ActiveSupport or Facets > is a fairly safe bet for the more common extensions. I agree by some degree. But it's also what makes them so popular. Because testing your code against different extension libraries is exponentially difficult. > 4. Using a unique method name, eg. String#smith_to_s if your project > is called Smith, is a fairly safe bet for more specialized extensions. true but it doesn't apply for all the cases. > Given all this I don't think this kind of API is worth the effort. The > real solution is, of course, Selector Namespaces. That's a more worthy > pursuit, IMO. But as far as I know, no one has yet been able to come > up with a fully comprehensible and user-friendly design for that. I > start to wonder if it is even possible. One doesn't forbid the other. Selector namespaces is an interesting idea, and you'll see I point to a similar project in the README.rdoc file. What I want, is a tool I can use right now, which doesn't require to change the language. Maybe this project can also be a tool to promote alternative and better solutions in the longer term. What do you think ? Send me your critical comments, I like it :) Cheers, zimbatm -- Posted via http://www.ruby-forum.com/.