半年前の話題ですが、ブックマークの整理で「クロージャによる超軽量並行プロセスの簡単実装法」 [1] が出てきたので Lua で写経してみました。 まず安直な翻訳。 function new() return { senders = {}, receivers = {} } end function send(channel, ...) if #channel.receivers == 0 then table.insert(channel.senders, {...}) -- push else local process = table.remove(channel.receivers, 1) -- shift process(...) end end function receive(channel, process) if #channel.senders == 0 then tab