local functions broke start_reading/start_writing

Looks like Lua's local functions lose access to outer scopes (upvalues)
or something like that..
This commit is contained in:
Kartik K. Agaram 2022-03-06 09:49:33 -08:00
parent 38ff2ddf11
commit f07eb03492
1 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@ function start_reading(fs, filename)
return result
end
local function reading_task(infile, chanout)
function reading_task(infile, chanout)
for line in infile:lines() do
chanout:send(line)
end
@ -36,7 +36,7 @@ function start_writing(fs, filename)
return result
end
local function writing_task(outfile, chanin)
function writing_task(outfile, chanin)
while true do
local line = chanin:recv()
if line == nil then break end -- end of file