[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: [Proposal] break do end
- From: "Thiago L." <fakedme@...>
- Date: Wed, 27 Aug 2014 23:17:07 -0300
It would be cool if you could use break with do ... end for some sort of
"safe goto"
Example:
do
break
local x = "you'll never see me"
print(x)
end
print("something")
Would print "something"
In 5.2+ we have this:
goto x
local x = ""
::x::
print("something")
But it errors instead of doing the scoping stuff you can do with do ... end
(This is probably not something for lua 5 but for lua 6 if/when we get
it... it would probably be less harmful to change goto so that it does
an implicit do ... end scoping thingy)