From: mental@... Date: 2006-02-10T03:38:01+09:00 Subject: Re: boolean annoyance Quoting Claudio Jeker : > OK this is a valid argument against changing behaviour because it > would cause a major regression to existing scripts. I think I > have to swallow this pill and change my coding stile for ruby. > Doing binary protocols in ruby is a bit more challenging than > expected. For what it's worth, if you find yourself typing stuff like: ( x & mask ).nonzero? over and over, you shouldn't tolerate that. DRY -- refactor the repeated bits it into a separate method instead. one possibility might be: class Integer def intersect?( mask ) ( self & mask ).nonzero? end end Used like: if x.intersect? 0x1c ... end Maybe you can think of a better name though. -mental