lua-users home
lua-l archive

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


On Thu, Aug 7, 2014 at 2:12 PM, Mason Mackaman <masondeanm@aol.com> wrote:
> AHHH! but I thought the only thing the metatable did was tell Lua to get _ENV.string whenever you try to index ’str’!? Sorry if I’m being annoying, I’m just trying to understand.


No, no. __index *is* the string table:

```
> print(string)
table: 0x77b700
> print(getmetatable("").__index)
table: 0x77b700
> print(getmetatable("").__index == string)
true

```

-- 
NI!

() - www.asciiribbon.org
/\ - ascii ribbon campaign against html e-mail and proprietary attachments