On 1213, Austin Ziegler wrote:
> On Sat, 13 Dec 2003 01:56:18 +0900, KONTRA Gergely wrote:
> > Why ruby handle booleans so liberally?
> It doesn't. Ruby treats all values excepting false and nil as true. It
> sounds like you're wanting 0 to be treated as false.
No, I'm just asking how ruby "dare" to convert my 0 to true (or false, it
is the same).
Everyone can write his/her own to_bool method INLINE. Shouldn't be a big
deal, but it can avoid some gotchas...

So in my philosophy, if 0 should raise a typeerror

So you are forced to write if 0!=0

(of course a=0;if a -> a=0; if a!=0 )

Do you think it's the camel's face?

Gergo

-- 
+-[ Kontra, Gergely<kgergely / mcl.hu> PhD student Room IB113 ]---------+
| http://www.mcl.hu/~kgergely            "Olyan langesz vagyok, hogy  |
| Mobil:(+36 20) 356 9656 ICQ: 175564914   poroltoval kellene jarnom" |
+-- Magyar php mirror es magyar php dokumentacio: http://hu.php.net --+