[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: false [was: The "Is nil present in a table" problem}
- From: David Jeske <jeske@...>
- Date: Wed, 28 Nov 2001 08:30:52 -0800
On Thu, Nov 29, 2001 at 01:25:57AM +0900, John Belmonte wrote:
> Scheme is a pretty serious as far as languages go and it manages to get by
> with just a false type.
Lua could get away without a false type, if we did away with the "nil
deletes a table entry" and the "standard table entry access returns
nil when not present".
My scheme is rusty, but I'm quite sure it does not overload all those
things onto the false type.
> Maybe expecting tables (or the language) to support full marshaling
> out-of-the-box is too much. There are still cases where you want some type
> associated with each field but want to allow for nil values. For example
> field "email_address" is a string but it happens to be nil right now meaning
> it's invalid or undefined. When you need that you're back to Rici Lake's
> table of tables technique.
This false/nil stuff breaks more than just XML/RPC. I've had trouble
doing proto-inheritence with it. Imagine you are a subclass of
someone. He has the property "a=1", you want to set a local value
"a=nil". Oops.. you can't do that, because you can't store nil.
There are many things I wish were different in Lua. I wish there were
real exceptions, I don't like the string formatting, and I'm sure
there are a handful of other things I would change if I really
cared. However, this false/nil thing is the only part of Lua which I
consider a broken wart.
(of course I like Lua anyhow, but it would be nice if this were fixed)
David Jeske (N9LCA) + http://www.chat.net/~jeske/ + firstname.lastname@example.org