[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: [proposal] close file on io.lines("filename", "*a")()
- From: "Soni \"They/Them\" L." <fakedme@...>
- Date: Tue, 30 Jul 2019 11:42:06 -0300
since lua doesn't have refcounting and some ppl wanna do basically
io.open(file):read("*a") I wanna propose io.lines("filename", "*a")()
(or alternatively io.lines("filename", "*a", "*l")) should close the
file as if the iterator ran out.
in other words if the first value isn't nil then check if the last value
is nil or the last argument is "*a" and if it is then close the file.