Re: The "Environment Stack" (+ lexically scoped string metatables)
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: The "Environment Stack" (+ lexically scoped string metatables)
- From: Paige DePol <lual@...>
- Date: 2017年11月29日 11:22:15 -0600
Soni They/Them L. <fakedme@gmail.com> wrote:
>>> `"%s %s" % {"hello", "world!"}` without affecting other modules/the main program.
>> I am sorry, but I don't understand the backtick string you've posted?
>
> getmetatable("").__mod = function(a, b)
> return string.format(a, table.unpack(b))
> end
Ah, okay, I get it now, thank you for the clarification! ;)
So the idea is that a module could be loaded and set that metatable and it
would then be active for the scope of that module only while not affecting
any of the other running code?
~Paige