lua-users home
lua-l archive

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


On Wed, Sep 14, 2016 at 7:42 AM, Coda Highland <chighland@gmail.com> wrote:
> On Wed, Sep 14, 2016 at 7:40 AM, Scott Morgan <blumf@blueyonder.co.uk> wrote:
>> On 14/09/16 15:04, Roberto Ierusalimschy wrote:
>>> The table {x=1, y=10} has one border, 1.
>>
>> Shouldn't that be 0?
>>
>> Scott
>
> No, it's 1. t[1] == nil and t[1-1] hits the inductive base case of the
> definition.
>
> /s/ Adam

Hmm. Actually, it's possible I was wrong.

>> On 14/09/16 15:04, Roberto Ierusalimschy wrote:
> That is, a border points to any position in a table where a non-nil value
> is followed by a nil value (or to 0, when position 1 is empty).

This is a little bit hard to understand. Is the border meant to point
to the last element, or to the first nil? The language might need some
refinement. I'll think about it for a while to see what I can come up
with.

/s/ Adam