[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: string.len(str) vs str:len()
- From: Elias Barrionovo <elias.tandel@...>
- Date: Thu, 7 Aug 2014 14:18:55 -0300
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
- References:
- string.len(str) vs str:len(), Mason Mackaman
- Re: string.len(str) vs str:len(), Thiago L.
- Re: string.len(str) vs str:len(), Mason Mackaman
- Re: string.len(str) vs str:len(), Thiago L.
- Re: string.len(str) vs str:len(), Mason Mackaman
- Re: string.len(str) vs str:len(), Coda Highland
- Re: string.len(str) vs str:len(), Thiago L.
- Re: string.len(str) vs str:len(), Mason Mackaman
- Re: string.len(str) vs str:len(), Coda Highland
- Re: string.len(str) vs str:len(), Mason Mackaman