lua-users home
lua-l archive

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




On Friday, January 9, 2015, Kevin Clancy <kclanc@gmail.com> wrote:
If that's the definition of nil, then what is the definition of null? They seem like the same thing to me.

On Fri, Jan 9, 2015 at 5:43 PM, Erik Hougaard <erik@hougaard.com> wrote:
On 09-01-2015 09:08, Enrique Arizón Benito wrote:
the invention of null (nil) references

"nil" is not null. I think you're trying to solve the right problem in the wrong place.

To quote the manual: "Nil is the type of the value nil, whose main property is to be different from any other value; it usually represents the absence of a useful value."

/Erik


nil is just a sentinel value, except it behaves as false in Boolean expressions. 

It has no further implied significance, even though it is used as the default return value for the __index handler of tables with no meta method defined.