All pastes #121090 Raw Edit

Someone

public text v1 · immutable
·published 2006-08-07 19:03 UTC
rendered paste body
function sortedPairs(t)
	local keys = {}
	for n in pairs(t) do table.insert(keys, n) end
	table.sort(keys)
	local i = 0
	local iter = function ()
		i = i + 1
		if keys[i] == nil then return nil
		else return keys[i], t[keys[i]]
		end
	end
	
	return iter

en