diff --git a/sequence.lua b/sequence.lua index 6964e83..36af9b9 100644 --- a/sequence.lua +++ b/sequence.lua @@ -13,6 +13,12 @@ local stable_sort = require(path .. "sort").stable_sort local sequence = class(table) --proxy missing table fns to tablex api +--iterators as method calls +--(no pairs, sequences are ordered) +--todo: pico8 like `all` +sequence.ipairs = ipairs +sequence.iterate = ipairs + --upgrade a table into a sequence, or create a new sequence function sequence:new(t) return self:init(t or {})