[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Implementing __index to return nil?
- From: Coda Highland <chighland@...>
- Date: Thu, 14 Feb 2013 18:06:46 -0800
On Thu, Feb 14, 2013 at 3:47 PM, Drake Wilson <drake@dasyatidae.net> wrote:
> Quoth Coda Highland <chighland@gmail.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
>
>
With the exception of MULTRET in the C API, what cases am I forgetting about?
/s/ Adam