Robert Klemme wrote:
> "Joel VanderWerf" <vjoel / PATH.Berkeley.EDU> schrieb im Newsbeitrag
> news:40177103.2040003 / path.berkeley.edu...
> 
>>Does anyone else think it would be nice to be able to pack/unpack
>>booleans? Maybe like this...
>>
>>[[true, false, true]].pack("y3")   # ==> "\005"
>>
>>I just chose 'y' because it's not used (as are [jokrt]), and it suggests
>>"yes", a boolean answer.
> 
> 
> irb(main):015:0> a=[true, false,true]
> => [true, false, true]
> irb(main):016:0> [a.inject(0){|acc,x| acc<<=1; acc|(x ?1:0)}].pack "I"
> => "\005\000\000\000"

That's nice. I'd still prefer something built into pack, so that this 
encoding can be expressed in the pack format string itself.