[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Making a string indexing metamethod
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 8 Nov 2006 07:10:32 -0200
> To allow string methods to continue to work, you can't just override
> __index.
Or you could use __call instead:
getmetatable("").__call = string.sub
print(("programming")(4,7))
--lhf