Command introduced in Tcl 8.6 for easier management of the prefix-matching of strings.
http://www.tcl.tk/man/tcl8.6/TclCmd/prefix.htm
Currently supports three subcommands.
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?”)
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.)
Returns the unique entry from the list, table, that string is a prefix of, or generates an error message.