[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: loadwithprefix and Lua 5.4
- From: Gavin Wraith <gavin@...>
- Date: Sat, 13 Feb 2021 11:29:36 GMT
I have been struggling with the "multiload" exercise in chapter 16
of Programming in Lua. I managed to cook up a "loadwithprefix"
that worked satisfactorily but when I extended it in the obvious
way with a postfix as well I got "file already closed" errors.
The io.lines iterator must have changed for Lua 5.4 to keep
track of when the file is to-be-closed, and so presumably an
extra upvalue of the iterator function is being used for this.
But I am getting a headache trying to work out from liolib.c
exactly what is going on. Can any kind expert give me some hints?
--
Gavin Wraith (gavin@wra1th.plus.com)
Home page: http://www.wra1th.plus.com/