[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: String tainting
- From: Luis Carvalho <carvalho@...>
- Date: Fri, 8 Feb 2008 11:39:57 -0500
> mt.__index = function(o, k)
> local s = strings[o]
> if k == "string" then
> return s
> else
> return s.k
> end
> end
Oops! This is better:
local strindex = getmetatable"".__index
mt.__index = function(o, k)
local s = strings[o]
return k == "string" and s or strindex[k]
end
Sorry for the noise.
Cheers,
Luis.
--
A mathematician is a device for turning coffee into theorems.
-- P. Erdos
--
Luis Carvalho
Applied Math PhD Student
Brown University