diff options
author | Karl Berry <karl@freefriends.org> | 2019-11-05 21:36:14 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-11-05 21:36:14 +0000 |
commit | 9e63b55e701a371d05992e63c3bb88c3b574ad76 (patch) | |
tree | 308b1549e0e231a7763604d9d64aa7273d8023d5 /Master/texmf-dist/tex/luatex/lualibs/lualibs-table.lua | |
parent | bc37372594a99affc612160cc16daec4df3079a0 (diff) |
lualibs (5nov19)
git-svn-id: svn://tug.org/texlive/trunk@52648 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/lualibs/lualibs-table.lua')
-rw-r--r-- | Master/texmf-dist/tex/luatex/lualibs/lualibs-table.lua | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/luatex/lualibs/lualibs-table.lua b/Master/texmf-dist/tex/luatex/lualibs/lualibs-table.lua index cffdcc23e20..e8282038674 100644 --- a/Master/texmf-dist/tex/luatex/lualibs/lualibs-table.lua +++ b/Master/texmf-dist/tex/luatex/lualibs/lualibs-table.lua @@ -287,6 +287,37 @@ local function sortedhash(t,cmp) return nothing end +-- local function iterate(t,i) +-- local i = i + 1 +-- if i <= t.n then +-- local k = t[i] +-- return i, k, t.t[k] +-- end +-- end +-- +-- local function indexedhash(t,cmp) +-- if t then +-- local s +-- if cmp then +-- -- it would be nice if the sort function would accept a third argument (or nicer, an optional first) +-- s = sortedhashkeys(t,function(a,b) return cmp(t,a,b) end) +-- else +-- s = sortedkeys(t) -- the robust one +-- end +-- local m = #s +-- if m == 1 then +-- return next, t +-- elseif m > 0 then +-- s.n = m +-- s.t = t +-- return iterate, s, 0 +-- end +-- end +-- return nothing +-- end +-- +-- -- for i, k, v in indexedhash(t) do print(k,v,s) end + table.sortedhash = sortedhash table.sortedpairs = sortedhash -- obsolete |