2 ms·
> 0 is truthy Nope. 0 being falsy only makes sense in pointer-oriented languages where NULL is a null pointer at address 0. In Lua, 0 is a number. It's not a p
by andrewmcwatters 8y ago
> 0 is truthy
Nope. 0 being falsy only makes sense in pointer-oriented languages where NULL is a null pointer at address 0. In Lua, 0 is a number. It's not a pointer address.
Which leads to:
> a={1} a[0]==nil a[1]==1 indexing starts at 1 but a[0]=1 does SOMETHING
So does -1: should -1 be falsy, too?
> if undefined … -- treated as nil
Pardon? It is. Are you asking for an undefined keyword? Why? In the Lua C API, you already get `lua_isnoneornil` to begin with.
> function pseudoclass:new …
Lua is a prototypal language.
> but by far the biggest complain is the packaging.
You know, thank God. Because JavaScript is probably the closest thing to Lua and look how that turned out.
The only thing holding it back is that the community doesn't need or want it. It's also small enough that perhaps no one has made a good package manager for Lua yet. But the `package` module in Lua already provides search paths, so it's fairly low effort. Frankly, I've never had a need for it. I don't want npm for Lua.