lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Jonathan Castello wrote:

D'oh, you're right. It would only be false if you did if (*t) {}. I'm
a bit out of practice with my C(++), as you can see!

In which case, I'm confused. Which language actually makes "" a false value?

Perl (probably inherited from awk). And in a language specifically
designed to practical text processing, that even makes sense.

In lua, just write

  v = ""
  if (#v>0) then ... end

Btw, lua's nil/0/"" behavior is one of my favorite things in the language.

Best wishes,
Taco