[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: local _META = {string = {__index = function(s, k) if type(k) == "number" then return string.sub(s, k, k) end return string[k] end}}
- From: Dirk Laurie <dirk.laurie@...>
- Date: Tue, 9 Dec 2014 07:46:36 +0200
2014-12-08 21:48 GMT+02:00 Thiago L. <fakedme@gmail.com>:
>
> On 08/12/14 05:47 PM, Thiago L. wrote:
>>
>>
>> On 08/12/14 02:15 PM, Dirk Laurie wrote:
>>>
>>> Do you expect the relationship
>>> `_ENV.string == getmetatable"".__index`
>>> to survive?
>>>
>> local _ENV = {string = {}}
>> print(_ENV.string == getmetatable"".__index) --> false
>>
> Wait actually I'm not sure what you're asking...?
Do you want string.sub(str,i,j) and str:sub(i,j) to do the
same (as it now does) after you have assigned something
to _META.string?
- References:
- local _META = {string = {__index = function(s, k) if type(k) == "number" then return string.sub(s, k, k) end return string[k] end}}, Thiago L.
- Re: local _META = {string = {__index = function(s, k) if type(k) == "number" then return string.sub(s, k, k) end return string[k] end}}, Dirk Laurie
- Re: local _META = {string = {__index = function(s, k) if type(k) == "number" then return string.sub(s, k, k) end return string[k] end}}, Thiago L.
- Re: local _META = {string = {__index = function(s, k) if type(k) == "number" then return string.sub(s, k, k) end return string[k] end}}, Thiago L.