summaryrefslogtreecommitdiff
path: root/tex/context/base/util-sto.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/util-sto.lua')
-rw-r--r--tex/context/base/util-sto.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/tex/context/base/util-sto.lua b/tex/context/base/util-sto.lua
index 34787be9b..19b8093c9 100644
--- a/tex/context/base/util-sto.lua
+++ b/tex/context/base/util-sto.lua
@@ -98,3 +98,14 @@ function storage.setinitializer(data,initialize)
end
setmetatable(data, m)
end
+
+local keyisvalue = { __index = function(t,k)
+ t[k] = k
+ return k
+end }
+
+function storage.sparse(t)
+ t = t or { }
+ setmetatable(t,keyisvalue)
+ return t
+end