lua-users home
lua-l archive

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


This might be a dumb question..

I was reading the source code for tables and I happened to bump into a concept that has always been somewhat obscure to me: table boundaries.

Are there any hidden usefulness for this?  I kinda find them a little confuse, and haven´t yet found a logical explanation for their behaviour:
<code>
a = {1, 2, 3, 4}

a[9] = 9

print(#a) -- prints 4

a[8] = 8

print(#a) -- prints 9
</code>

Isn´t it confusing?

---
Luís E. Jason Santos