View Single Post
12-28-09, 01:18 AM   #6
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
Originally Posted by Taroven View Post
Code:
local foo = {}
foo.bar = nil
print(foo.bar or "LOL")
-- Result: nil
That's odd, because the expression nil acts as false, so this should return "LOL" as well regardless of whether or not nil was manually assigned to the variable or table entry.

Edit: Just to make sure, I ran this through Lua and it works as I had described.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 12-28-09 at 05:58 AM. Reason: 1:Confirmed 2:Code block used for better distinction in quote
  Reply With Quote