On 11/22/05, James Edward Gray II <james / grayproductions.net> wrote:
>
>  >> bits = Array.new(8) { |i| 7[i] }.reverse!
> => [0, 0, 0, 0, 0, 1, 1, 1]

And the winner by a nose is.................................
...............................
...............................
James!!!

----------------------------------------------------------------------
|                     QuickBench Session Started                     |
|                         300000 Iterations                          |
----------------------------------------------------------------------
                               user     system      total        real
1. 244.to_ba               3.296000   0.015000   3.311000 (  3.313000)
2. Array.new(8) { |i| ...  2.782000   0.000000   2.782000 (  2.781000)
----------------------------------------------------------------------
|              Fastest was <2. Array.new(8) { |i| ...>               |
----------------------------------------------------------------------

I'm glad you posted this because it is elegant and fast. OK, now I'll
stop spamming this thread with benchmark results :)

Regards,
Ryan