[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Locals by default yet again, sorry :)
- From: Abhijit Nandy <abhijit.nandy@...>
- Date: Wed, 31 Jul 2019 16:55:59 +0530
Thanks everyone for the suggestions :)
It will take me a while to fully absorb them, I ll get back with any queries after trying them all out.
On Tue, Jul 30, 2019 at 4:37 PM Sergey Kovalev <firstname.lastname@example.org> wrote:
> I try "do <localonly>".It is not similar to noupvalues. It is like
> pure function more.
> I think patch with pure fuction was too vicious in many cases.
> So noupvalues more friendly. It simply hides all upvalues except _ENV.
> But now I cann't say what kind is better.
Yes, it is not fully equivalent, but you can workaround the limitation
with something like:
local env = _ENV -- or local _ENV = _ENV if you prefer
However I think <withupvalue> is closer to what Abhijit was looking
for (if he can live without direct access to globals).