[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: controlling library load
- From: Viacheslav Usov <via.usov@...>
- Date: Sat, 24 Sep 2022 15:35:15 +0200
On Sat, Sep 24, 2022 at 1:08 AM Javier Guerra Giraldez
<javier@guerrag.com> wrote:
I believe your code:
> local old_require = require
> local stateOpen = false
>
> function my_require(lib)
> if stateOpen then
> return old_require(lib)
> end
>
> if allow_list(lib) then
> local prev_state = stateOpen
> stateOpen = true
> local r = old_require(lib)
> stateOpen = prev_state
> return r
> end
> end
is equivalent to this code:
local old_require = require
function my_require(lib)
if allow_list(lib) then
local stateOpen = true
return old_require(lib)
end
end
And I do not see how it addresses my problem. Can you clarify?
Cheers,
V.