> It's a kind of amalgamation of boolean flip-flops and > Enumerbale#partition. The name appears to be in doubt. IMO, 'gather' > is too similar to 'collect', and to a slightly lesser extent, > 'select'. 'chunk' or 'chunk_by' seems to capture the intent of the > method better. (I disagree with the suggestion that the block could > return certain underscore-prefixed symbols to control the method's > operation; it seems inelegant). partition_by perhaps? A few related attempts have been: rails' group_by [1] >> (1..10).group_by{|n| n & 2} => {0=>[1, 4, 5, 8, 9], 2=>[2, 3, 6, 7, 10]} and enumerable_mapper gem's: >> (1..10).grouped_by{|n| n & 2} => [[0, [1, 4, 5, 8, 9]], [2, [2, 3, 6, 7, 10]]] The output of the latter is a little more of what I had expected the "gather" method to do, too, something that includes the values (1..10).chunk_by {|n| n & 2 } #=> [0, [1]] # 1 & 2 = 0 # [1, [[2, 3]] # 2 & 2 = 3 & 2 = 1 # [0, [[4, 5]] # 4 & 2 = 5 & 2 = 0 # [1, [[6, 7]] # 6 & 2 = 7 & 2 = 1 # [0, [[8, 9]] # 8 & 2 = 9 & 2 = 0 # [1, [[10]] # 10 & 2 = 1 otherwise you lose your gathered values which might not be as useful. >> * SQLite as a standard library >> * [ruby-dev:38463] That might be quite useful, but why is the question. To make it more available to users, since it comes by default [i.e. the equivalent of bundling the sqlite headers along with ruby and including a sqlite gem]? I have a few suggestions for core change too, that might be considered...guess I'll throw them all out here now since we're in the Ruby RCR mood... 1) allow for better multi line comments history: currently there is not easy way to do multi line comments except by adding many #'s to the beginning of each line, or adding a somewhat [to me] jarring begin code =begin some code =end continue code So the request is for prettier multi line comments. Most people on ruby talk call me crazy for wanting this, but I just cringe every time I have to do it in Ruby. The possible options would be to introduce a new multi-line comment delineator [like /* */] or perhaps modify the =begin syntax to allow for it to not be at the beginning of a new line =begin some code =end more code. I'm not one of those with a cool enough editor to do the multi line comments for me [and many aren't], so such an addition would result in cleaner looking multi line comments--at least to me. 2) default BasicSocket.do_not_reverse_lookup to true. background: Currently ruby socket code defaults to always doing a reverse DNS lookup when it can [ex: once per incoming UDP packet]. This causes "surprising" pauses when the lookup fails, because the DNS waits 15s to timeout, before passing the packet back to the program--the (possibly random) pause is unexpected. to see this in action: http://betterlogic.com/roger/?p=1646 comment out the do_not_reverse_lookup on the receiver and change the sender to send to IP127.0.0.255 and watch the "slow for now reason" packets come in. The example works great [no pauses] if you set BasicSocket.do_not_reverse_lookup to true, and is much less surprising. This isn't the first time I've been bit by ruby's internal DNS lookups, and others have similarly been bit by this, and it always causes confusion. It also decreases the network traffic overhead, etc. A followup suggestion would be to deprecate do_not_reverse_lookup and in its place create reverse_lookup so that you don't have to use as many double negatives. [2] 3) with ruby in "-d" or "-v" mode (debug, verbose) don't swallow any lines from the exception backtrace given when a program exits because of uncaught exception. Those swallowed lines are sometimes useful, and it is inconvenient to not be able to get at them easily. So I'd suggest that if ruby's in verbose mode, they not be swallowed. Thoughts? 4) (the controversial one). Have load 'rubyscriptname' behave the same as require 'libraryname' in terms of extension guessing. It's surprising to me when require doesn't require extension but load does, because require and load typically both end up being used against .rb files, so when I go from one to the other, I'm forced to include extension. It's confusing for newbies (and surprising for me). Just thought I'd get those off my chest. Thoughts? -=roger [1] http://allgems.faithpromotingstories.org/gems/doc/activesupport/2.3.2/classes/Enumerable.html#M000948 [2] http://www.ruby-forum.com/topic/184011#new