News for hackers. Stuff that matters.
Re:I open sourced my game along with a tutorial on how to ma... by DarkWiiPlayer on Monday July 06, 2020 @03:36AM (#23745574)
0? Because Lua isn't C. It makes sense for C to treat 0 as falsey, because (void*)0 is Cs way of expressing a nil-value, as well as not having a dedicated boolean value to keep the language simpler.

Lua, both has a dedicated nil value and a boolean type, so there's no reason whatsoever to treat zero as falsey, other than the C cargocult.

As for empty strings, I really don't see the rationale behind it. An empty string is not nothing. At the very least, it still holds the length-data of 0, so it's conceptually more than just nil and should thus still be truthy.

There are no comments on this comment yet.