[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Propsoal: a lua dialect without nil
- From: Axel Kittenberger <axkibe@...>
- Date: Wed, 16 Feb 2011 14:50:00 +0100
> You may just rename "undefined"->"nil" and "nil"->"false":
>
> t = {}
> print(t["somesting"]) --> prints "nil"
> t["somesting"] = false
> print(t["somesting"]) --> prints "false"
>
> Both nil and false evaluate to false when used in an if statement.
Indeed, false as mostly-replacement for a first-class-nil has its
virtues, only exception is in a list of booleans with "unknown" or
"errornous" values.