Regarding the 3x3 neighborhood of a cell, my favorite solution is this: ```ruby board = {} # x+y.i => v fill(board) [-1i-1, -1i, -1i+1, -1, +1, 1i-1, 1i, 1i+1].each do { |dir| board[pos + dir] } ``` It avoids the nested loop ...Eregon (Benoit Daloze)
This looks nice but I think Range intersection is more general and more useful. It's also symmetrical which seems a nice property. Manually implementing Range intersection is not trivial and having built-in would be great. We already ha...Eregon (Benoit Daloze)
* While perusing code in hash.c I found it suspicious that ar_find_entry_hint() didn't reread bound in the loop and yet called arbitrary code through #eql?. * ar_find_entry_hint() before this commit would not check if bound or the stor...Eregon (Benoit Daloze)
I agree with @zverok, this looks very much *not* Ruby-like to me. I also see no need for it. It feels more like Python or Scala. Python has `for` comprehensions because it doesn't even have a decent `map` or `filter` (only as a top-level...Eregon (Benoit Daloze)