Skip to content

__silent_functions__

builtin · libnexusinterp/parse-tree/pt-eval-proprietary.cc

: val = __silent_functions__ ()
: old_val = __silent_functions__ (new_val)
: old_val = __silent_functions__ (new_val, "local")

Query or change whether automatic display of results is suppressed while a function body runs.

The current setting is returned when called with no argument; given new_val the flag is set and the previous setting is returned.

While the flag is off (the default), an expression evaluated inside a function whose statement does not end in a semicolon has its result printed, just as it would be at the prompt. Turning the flag on keeps those intermediate results from appearing as the function executes.

Used with the "local" keyword inside a function, the change is confined to that function and its callees, with the earlier value restored on return.