[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua-l Digest, Vol 105, Issue 13
- From: Dirk Laurie <dirk.laurie@...>
- Date: Sun, 7 Apr 2019 19:29:28 +0200
Op So. 7 Apr. 2019 om 17:55 het Sergey Kovalev <kovserg33@gmail.com> geskryf:
TL;DR
>
> return load([[
> function strict(s)
> return setmetatable({},{
> __index=function(t,n)
> if s[n]==nil then error("no "..n.." defined",3) end
> return s[n]
> end,
> __newindex=function(t,n,v)
> if s[n]==nil then error("no "..n.." defined",3) end
> s[n]=v
> end,
> })
> end
> local _ENV=strict{} return function ]]..fn.." end")()
That last 'end' is probably wrong.