> Also - what other languages treat "0" as false?
Num yes Str no
>>> !! 0 false >>> !! "0" true
Num yes Str no
>>> not not 0 False >>> not not "0" True
Num no Str no
irb(main):002:0> !! 0 => true irb(main):003:0> !! "0" (irb):3: warning: string literal in condition => true
Num yes Str yes
DB<102> !! 0 => "" DB<103> !! "0" => ""
Cheers Rolf
( addicted to the Perl Programming Language)
In reply to Re^3: Wrong idioms
by LanX
in thread Wrong idioms
by McA
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |