summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/supple/comms.lua5
-rw-r--r--lib/supple/objects.lua1
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/supple/comms.lua b/lib/supple/comms.lua
index 639ce33..ef44666 100644
--- a/lib/supple/comms.lua
+++ b/lib/supple/comms.lua
@@ -160,6 +160,11 @@ local function wait_for_response()
obj[back.args[1]] = back.args[2]
return {}
end)
+ elseif back.method == "__next" then
+ safe_method(function()
+ local obj = objects.receive { tag = back.object }
+ return {next(obj, back.args[1])}
+ end)
else
safe_method(function()
local obj = objects.receive { tag = back.object }
diff --git a/lib/supple/objects.lua b/lib/supple/objects.lua
index 9220502..5a5dfca 100644
--- a/lib/supple/objects.lua
+++ b/lib/supple/objects.lua
@@ -129,6 +129,7 @@ local function receive(obj)
obj.methods[#obj.methods+1] = "__len"
obj.methods[#obj.methods+1] = "__index"
obj.methods[#obj.methods+1] = "__newindex"
+ obj.methods[#obj.methods+1] = "__next"
end
for _, name in ipairs(obj.methods or {}) do
local function meta_func(mobj, ...)