View Single Post
08-26-10, 11:46 AM   #5
Sythalin
Curse staff
 
Sythalin's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 680
Ok, now I'm more lost. Perhaps because I'm sick and not thinking straight at this time (I'm outta DayQuil )

lua Code:
  1. CNames_Options.enemy = (CNames_Options.enemy == nil) and true or CNames_Option.enemy

I think I'm understanding this wrong. From the looks, it looks like the first comparison is looking for nil and true, which is impossible as far as I know; Some cannot be true and not exist.

lua Code:
  1. CNames_Options.enemy = not (CNames_Options.enemy == false)

I'm not even sure how this works. Again, using terms of the boolean values, I read this as false = not false and true = not false. I think it's the formatting that I don't seem to understand.

lua Code:
  1. if CNames_Options.enemy == nil then
  2.     CNames_Options.enemy = true
  3. end
This is the format I'm used to, I've just been trying to eliminate the need for 10,000 if-then-else statements.

What I'm wondering at this point is if this is just the behaviour when using Boolean. Because from what I've used before CNames_Options = CNames_Options or {} works the way I'm thinking it would.
  Reply With Quote