From: Austin Ziegler Date: 2003-09-27T01:10:42+09:00 Subject: Re: Adding, removing and redefining features at runtime On Sat, 27 Sep 2003 00:05:48 +0900, Martin DeMello wrote: > Gavin Sinclair wrote: >> PS. I am launching a project that consolidates popular extensions to >> the standard classes. Look at project "extensions" on RubyForge if >> you're interested. The CVS will hopefully be there within 7 days. A >> release will be a few more weeks. This is inspired by that nagging >> feeling. Instead of implementing common modifications in my code, I can >> rely on a reference implementation that is documented and tested. > Excellent idea. Two questions, though - how do you define popularity, and > how do you avoid bloat? I can think of two things that should be there: #map_with_index and number formatting, since they appear every so often. Other examples exist, I am sure, but seeing what extensions are listed on the RubyGarden wiki would be a good start. IMO, the way to avoid bloat is like this: ext.rb # loads everything ext/numeric ext/numeric.rb # loads all extensions to Numeric classes ext/numeric/format.rb ext/enumerable ext/enumerable.rb # loads all extensions to Enumerable ext/enumerable/map.rb The file ext/numeric/format.rb could contain the number formatting routine I wrote and is currently on the RubyGarden wiki. If there are other numeric formatting routines, they could be put there as well. The file ext/enumerable/map.rb could contain #map_with_index. What do you think? -austin -- austin ziegler * austin@halostatue.ca * Toronto, ON, Canada software designer * pragmatic programmer * 2003.09.26 * 12.01.15