[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua Performance, IO / Regexp
- From: "steve donovan" <steve.j.donovan@...>
- Date: Tue, 23 Oct 2007 09:28:53 +0200
On 10/23/07, Mariano Kamp <mariano.kamp@acm.org> wrote:
> Quick follow up question to the use of local variables to store
> functions: When I use local s_find = string.find can I still use the
> "object oriented" syntax like line ="abc"; hit = line:find("xyz")??
You can. The local variable just keeps the function at a fixed offset
so there's no table lookup. I think 'line:find()' is more elegant, but
it involves looking up 'find' in line's metatable.
steve d.