Quantcast
Channel: Lua, if statement idiom - Stack Overflow
Viewing all articles
Browse latest Browse all 4

Lua, if statement idiom

$
0
0
local a = {}local b = {}local c,d = (a~=nil) and 1,1 or 0,0 -- prints "1 1"local c,d = (a==nil) and 1,1 or 0,0 -- prints "false 1"print(c,d)

I get why this happens. Is there a way to print "0 0"?


Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>