Used in the St4sh
- S3maphore: music/core.lua — A production music loop combining actor state, transitions, cleanup, magic checks, and randomized selection.
- Static Switching System: actionHandlers.lua, moduleCatalog.lua, staticReplacements.lua, global.lua — Action variation, spatial indexing, content fingerprints, and optional callbacks across the replacement pipeline.
- S3UI: player_camera.lua, inventory/window.lua — Small UI fallbacks where an optional callback needs to remain callable.
These helpers are deliberately minimal. They are useful at seams where a callback or table operation is optional, but they should not be mistaken for a framework or a performance strategy.
clear
require 'scripts.s3.clear'(table) → nilclear(t) removes every key from t in place. It uses table.clear when the runtime provides it and otherwise falls back to iterating with next. The table identity is preserved; the function does not copy or return a replacement.
local clear = require 'scripts.s3.clear'
clear(workList)
The input must be a table. Clearing while another part of the program retains the same table is intentional; clearing does not release references held by other values.
nullFunction
require 'scripts.s3.nullFunction' → function(...)nullFunction is a shared no-op callback. It accepts and ignores any arguments and returns no values.
local nullFunction = require 'scripts.s3.nullFunction'
local onDone = optionalCallback or nullFunction
onDone(result)
Both modules are plain Lua and have no OpenMW context or lifecycle requirements. Use ordinary local code instead when the helper does not make an optional boundary clearer.