Differences From
Artifact [8f6ee343ec]:
156 156 exp = '<' .. state.tbls[p] ..'>'
157 157 done = true
158 158 else
159 159 state.tbls[p] = path and string.format('%s.%s', path, k) or k
160 160 end
161 161 end
162 162 if not done then
163 - local function dodump() return dump(
163 + local function dodump() return ss.dump(
164 164 p, state,
165 165 path and string.format("%s.%s", path, k) or k,
166 166 depth + 1
167 167 ) end
168 168 -- boy this is ugly
169 169 if type(p) ~= 'table' or
170 170 getmetatable(p) == nil or
................................................................................
364 364 if mm.__name == 'class' then
365 365 return g
366 366 else
367 367 return nil
368 368 end
369 369 end
370 370
371 +function ss.walk(o, key, ...)
372 + if o[key] then
373 + if select('#', ...) == 0 then
374 + return o[key]
375 + else
376 + return ss.walk(o[key], ...)
377 + end
378 + end
379 + return nil
380 +end
381 +
382 +function ss.coalesce(x, ...)
383 + if x ~= nil then
384 + return x
385 + elseif select('#', ...) == 0 then
386 + return nil
387 + else
388 + return ss.coalesce(...)
389 + end
390 +end