From: matz@... (Yukihiro Matsumoto) Date: 2001-03-06T15:48:33+09:00 Subject: [ruby-talk:12096] Re: Another hook Hi, In message "[ruby-talk:12095] Re: Another hook" on 01/03/06, Dave Thomas writes: |> And performance would be the excuse again. | |Would it be that bad in reality? You'd only have to do the call if |to_bool was defined anywhere, so for programs that didn't use it it |would only be a single instruction added to the path. I'm sure we can |find one to take away somewhere to compensate... :) If there's none, it must be OK. But for example, if there's only one to_bool among the required libraries, all conditional tests would be slowed, unless I misunderstood something. The boolean check is done by the RTEST() macro in the source now. It used to be a function (I mean a C function). When I changed this into bit-tweaking macro (in fact, Nobuyoshi Nakada sent me a patch), performance was improved by several percent. It depends on the view whether it's enough price to pay, and on how much often to_bool used. matz.