[DGD] A short question about nil, comparisons and strings.

Par Winzell zell at skotos.net
Wed Jan 7 00:22:41 CET 2004


> Ithe logical not operator is proceeded with 'nil', does it return true or 
> false? I am assuming !0 is true and !nil is true in my code so far.

0, 0.0 and nil are all false, so !0 == !0.0 == !nil == 1 (true)

"" is true

> What about strings? What is a string initiated as, "", 0, or nil? Are all 
> those constants different?

they're all different. strings are initialized to nil.

_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list