lua-users home
lua-l archive

Re: lua-l Digest, Vol 105, Issue 13

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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.

AltStyle によって変換されたページ (->オリジナル) /