Pascal J. Bourguignon wrote:
> (def check(permissions,bits)
>   (bits . inject(true) { | r , b |
>                     (r and (0 != (permissions & (1 << b))))
>                  })
> end)


That what happens when one spends his time typing parenthesis instead of 
programming, my dear Pascal. I managed to count at least two bugs there. 
One, you need to do (1 << (b-1)). Two, if you pass [] as the bits, the 
result will be 'true'.
-- 
Posted via http://www.ruby-forum.com/.