[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Implementing __index to return nil?
- From: Drake Wilson <drake@...>
- Date: Thu, 14 Feb 2013 17:47:14 -0600
Quoth Coda Highland <email@example.com>, on 2013-02-14 14:54:02 -0800:
> There's no difference. nil means no value. In terms of Lua code,
> failing to return anything means that the function is treated as
> returning nil.
This is not true in general, though it's true much of the time.
In a context that expects exactly one value, such as __index
return values, returning nothing gets adjusted to a single nil.
So they are the same in this case.
---> Drake Wilson