SplitScript reference / Language / inspect
inspect
keyword
inspect(expression)
Publishes a live debug value and returns it unchanged.
inspect evaluates its operand once, temporarily reuses the variables panel to display the value under the operand's trimmed source spelling in debug builds, and produces that same typed value. When a surrounding expression consumes the result, release lowering keeps the operand but removes inspection formatting and its runtime dependency. A standalone inspect(expression) statement is implicitly debug-only: release builds omit the complete statement and do not evaluate expression or any of its side effects. Declarations reached only by standalone inspections receive debug-modifier guidance. The operand must implement Display. Use setVariable for intentional end-user-facing information displayed on the speedrun timer in both profiles and print for a chronological diagnostic log.
Examples
Publish and keep using a value
let level = inspect(current.level)