[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: function call & table create
- From: "Wim Couwenberg" <w.couwenberg@...>
- Date: Fri, 31 Jan 2003 23:03:18 +0100
Hi,
I just remembered that Lua 5 introduced the string.gfind function which is a
bit more elegant for this purpose (see previous mail):
-- string form
local function locate(table, path)
local t = table
for part in string.gfind(path, "(%w+)") do
t = t[part]
if not t then break end
end
return t
end
Bye,
Wim