1 module("lazy", package.seeall)
6 return setmetatable ({raw=f}, THUNK_MT)
9 is_thunk = |th| getmetatable(th) == THUNK_MT
12 if not is_thunk(th) then return th
13 elseif th.raw then th.value=th.raw(); th.raw=nil; return th.value
14 else return th.value end
18 local mt = { __rawtable = t }
19 function mt.__index(_, key) return force(t[key]) end
20 function mt.__newindex(_, key, val) t[key]=val end
21 return setmetatable({}, mt)