Bernard Miller wrote:

> The nature of bitwise ops is one that requires a solid
> grasp of what it is you?re manipulating. I would argue
> that bitwise ops should be removed from fixnum and
> bignum. Instead, have a class representing a bit field
> of arbitrary size that can be converted back to an
> integer or anything else that can be constructed with
> a fixed number of bits --especially a byte.

I think Robert Feldt's BitVector extension module:

     http://www.ruby-lang.org/raa/list.rhtml?name=bitvector

provides what you're describing.