[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: game developers?
- From: David Jeske <jeske@...>
- Date: Mon, 31 Jul 2000 11:20:44 -0700
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