lua-users home
lua-l archive

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


Title: RE: false [was: The "Is nil present in a table" problem}

True, but Scheme also has a symbol type which allows it to have a distinct value for true (#t).  The symbol type also makes things like enumerations alot nicer to work with, and is one of the few things from Scheme I really miss in Lua.

--
Alex R. Moon
alexm@mailcode.com
http://www.mailcode.com
 

> -----Original Message-----
> From: John Belmonte [mailto:jvb@prairienet.org]
> Sent: Wednesday, November 28, 2001 11:26 AM
> To: Multiple recipients of list
> Subject: Re: false [was: The "Is nil present in a table" problem}
>
>
> Paul Chakravarti wrote:
> > I would prefer that this explicitly evaluated to a
> > distinct 'true' type - if there is no explicit 'true' value
> > it is impossible to correctly serialise the value for
> > an API which expects a destinct boolean value (in
> > this case specifically XMLRPC but generally true) by
> > checking the type.
>
> Scheme is a pretty serious as far as languages go and it
> manages to get by
> with just a 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.
>
> -John
>
>