[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Why do we need “toclose” (or those angle brackets) at all?
- From: Sergey Zakharchenko <doublef.mobile@...>
- Date: Fri, 14 Jun 2019 12:16:07 +0000
Paul,
> Why do we need the ugly, weird-looking and controversial <toclose> notation at all?
Indeed, so many people don't like it, but fail to notice one thing.
You don't have to use it!
local function scope(object)
return next,{[object]=1},nil,object
end
for file in scope(io.open("file")) do
print("I can use file ",file)
end
print"File has been closed!"
People trying to get others to use variants of 'with' don't notice
it's there already.
Please. Things are going fine.
Best regards,
--
DoubleF