[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Suggestion: names-isolation-statement
- From: v <v19930312@...>
- Date: Fri, 12 Jul 2019 23:31:00 +0300
On Fri, 2019-07-12 at 00:15 +0300, Egor Skriptunoff wrote:
> This statement makes all names from the outer scope (with exception
> of white-listed names) invisible in the inner block.
> The statement works for all names independently of what a name is:
To put it the other way: only specified free names are accessible.
Suggestion looks fairly good for me and I think shouldn't be too hard
to implement (no VM tweaks required as it's purely syntactic sugar).
One possible extension to it: add <const> (and probably <toclose> as
well?) specifier, so you can make sure that var isn't changed by
accident. Again, as we already have <const> locals, this probably
shouldn't be too hard to add into existing code.