introduced in Tcl
8.6 for easier management of the prefix-matching of string
- tcl::prefix subcommand …
Currently supports three subcommands.
- tcl::prefix all table string
This returns all values from the list, table
, that start with string
. (This answers the question “what values in the table start with a prefix?”)
- tcl::prefix longest table string
Returns the longest prefix of the subset of values in the list, table
, such that the values all begin with string
. (This answers the question “what can I extend my current prefix to, while not changing the set of words which I've got a prefix of?” which is useful for tab-completion.)
- tcl::prefix match options… table string
Returns the unique entry from the list, table
, that string
is a prefix of, or generates an error message.