diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-03-06 09:49:33 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-03-06 09:49:33 -0800 |
commit | f07eb03492814aeb91546cf856b7facc3c347954 (patch) | |
tree | f52c2a13b38517ec7f5e66717f7dd40417ee6751 /src/file.lua | |
parent | 38ff2ddf11dc686a83be721d705e86c48538c837 (diff) | |
download | teliva-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..
Diffstat (limited to 'src/file.lua')
-rw-r--r-- | src/file.lua | 4 |
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 |