[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Suggestion: names-isolation-statement
- From: pocomane <pocomane_7a@...>
- Date: Sat, 13 Jul 2019 14:24:57 +0200
This might solve the long-standing problem with globals.
What about something like the following?
x = 0
y = 1
local print, x = print, xdo <error-on-free-name>
print(x) -- no issue
print(_ENV.y) -- no issue
print(y) -- error at compile time
I.e. inside the annotated do/end block, any free name raises an error at compile time, instead of being translated to _ENV.y .