From: matz@... (Yukihiro Matsumoto) Date: 2004-07-15T15:13:02+09:00 Subject: Re: when will coerce be called? Hi, In message "when will coerce be called?" on 04/07/15, "Xiangyu Yang" writes: |I want to treat "true" as 1 and "false" as 0. So I do: |class TrueClass |def coerce(other) |[other,1] |end |end |But the code works only for +, -; not for &, |. |Why? "coerce" is only used for numeric operators, not logical operators. You can redefine "to_int" for the purpose (tough I don't recommend). matz.