Re: The problem with or and false
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: The problem with or and false
- From: Adrian Sietsma <adrian_groups@...>
- Date: 2006年3月31日 01:12:13 +1000
Alexander Gladysh wrote:
Unfortunately, I need to have all tables in "honest" state, so such
joined usage would be completely transparent for their other users.
how about a generic join ? (not as fast as your function approach, i think)
join = function(...)
local t1 = arg -- {...} for 5.1
return setmetatable({},
{
__index = function(t, k)
for tt,i in ipairs(t1) do
local ret = tt[k]
if (ret~=nil) then return ret end
end
error("Not Found" .. k )
end;
-- Skip __newindex for clarity.
}
end
Adrian.