aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-03-06 09:49:33 -0800
committerKartik K. Agaram <vc@akkartik.com>2022-03-06 09:49:33 -0800
commitf07eb03492814aeb91546cf856b7facc3c347954 (patch)
treef52c2a13b38517ec7f5e66717f7dd40417ee6751
parent38ff2ddf11dc686a83be721d705e86c48538c837 (diff)
downloadteliva-f07eb03492814aeb91546cf856b7facc3c347954.tar.gz
local functions broke start_reading/start_writing
Looks like Lua's local functions lose access to outer scopes (upvalues) or something like that..
-rw-r--r--src/file.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/file.lua b/src/file.lua
index faac0c3..18ee718 100644
--- a/src/file.lua
+++ b/src/file.lua
@@ -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