lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I just realized that when I made my Lua-wish-list before with you so
dilligently responded to, I forgot to include the most important item.

- having the ability to represent a "false" boolean value that takes up 
  space!

If you look at how the simple Lua proto-inheritence example works, you
will see the problem.

a = { is_visible = 1 }
b = { parent = a }

If these tables are using the proto-inheritence tag methods, then:

print(b.is_visible)   ==>   "1"
b.is_visible = 2 
print(b.is_visible)   ==>   "2"
b.is_visible = nil
print(b.is_visible)   ==>   "1"


There is no way to store a false value into a table, so there is no
way to use inheritence for boolean values. 

I've had to change all boolean IF tests in my code to be:

if b.is_visible == 1 then

Solutions that seem useful to me would be:
 - allowing "0" to be considered false 
 - creating a "real false" value, which looks like nil, but takes
   up space.

-- 
David Jeske (N9LCA) + http://www.chat.net/~jeske/ + jeske@chat.net