::tclinterp¶
Commands¶
configure¶
Queries or changes package-wide representation and collision defaults in this Tcl interpreter.
configure ?option? configure ?-input list|vector? ?-output list|vector? ?-ifexists error|replace?
Parameters
-ifexists policy:Default destination collision policy: error or replace; initially error.
-input mode:Default input representation: list or vector; initially list.
-output mode:Default output representation: list or vector; initially list.
Description
With no arguments, returns all settings as an option/value dictionary. With one option, returns its value. With option/value pairs, validates all settings before applying them and returns the complete configuration. Invalid options or values, or unavailable RBC support leave the configuration unchanged. Selecting vector mode requires an RBC-enabled build and a loadable rbc::vector package; list queries/settings do not load RBC. Defaults are independent in separate interpreters.
Omitted -input, -output and -ifexists options use these defaults on each interpolation call. Explicit call options take precedence. Input and output modes can be configured independently. This public command is not namespace-exported; call it as ::tclinterp::configure. The collision policy affects vector output only; it can be configured while using list mode or without RBC. Replacement still requires a compatible, writable destination. Namespace selection and naming are unchanged.
Example:
set saved [::tclinterp::configure]
::tclinterp::configure -input vector -output vector -ifexists replace
::tclinterp::configure -output
::tclinterp::configure {*}$saved
Return value
selected option value for a single-option query; otherwise all settings as a dictionary.
Copyright (c) George Yashin