{
 "version": 1,
 "commands": [
  {
   "name": "string",
   "area": "strings",
   "synopsis": [
    "string SUBCOMMAND ?ARG ...?"
   ],
   "summary": "The commands for text: length, search, compare, change, and test.",
   "names": [
    "string"
   ],
   "subcommands": [
    {
     "synopsis": "string length STRING",
     "summary": "Gives the count of characters of a string."
    },
    {
     "synopsis": "string length -grapheme STRING",
     "summary": "Counts grapheme clusters in place of characters."
    },
    {
     "synopsis": "string bytelength STRING",
     "summary": "Gives the count of bytes of the UTF-8 form of a string. Tcl 8.6 only."
    },
    {
     "synopsis": "string insert STRING INDEX TEXT",
     "summary": "Gives a string with text put before the character at an index. Tcl 9.1 only."
    },
    {
     "synopsis": "string index STRING INDEX",
     "summary": "Gives the character at an index of a string."
    },
    {
     "synopsis": "string index -grapheme STRING INDEX",
     "summary": "Counts INDEX in grapheme clusters, and gives a whole cluster."
    },
    {
     "synopsis": "string range STRING FIRST LAST",
     "summary": "Gives the characters of a string from one index to another."
    },
    {
     "synopsis": "string range -grapheme STRING FIRST LAST",
     "summary": "Counts FIRST and LAST in grapheme clusters."
    },
    {
     "synopsis": "string first NEEDLE HAYSTACK ?START?",
     "summary": "Gives the index of the first match of a substring."
    },
    {
     "synopsis": "string last NEEDLE HAYSTACK ?LAST?",
     "summary": "Gives the index of the last match of a substring."
    },
    {
     "synopsis": "string compare ?-nocase? ?-length N? A B",
     "summary": "Compares two strings character by character."
    },
    {
     "synopsis": "string equal ?-nocase? ?-length N? A B",
     "summary": "Tests whether two strings are the same text."
    },
    {
     "synopsis": "string match ?-nocase? PATTERN STRING",
     "summary": "Tests whether a glob pattern matches the whole of a string."
    },
    {
     "synopsis": "string map ?-nocase? MAPPING STRING",
     "summary": "Replaces each key of a list of keys and values with its value."
    },
    {
     "synopsis": "string repeat STRING COUNT",
     "summary": "Gives a string repeated a number of times."
    },
    {
     "synopsis": "string replace STRING FIRST LAST ?NEW?",
     "summary": "Gives a string with a range of characters replaced by other text."
    },
    {
     "synopsis": "string reverse STRING",
     "summary": "Gives the characters of a string in the reverse order."
    },
    {
     "synopsis": "string reverse -grapheme STRING",
     "summary": "Reverses the order of the grapheme clusters, each with its characters in order."
    },
    {
     "synopsis": "string tolower STRING ?FIRST? ?LAST?",
     "summary": "Gives a string with its letters in lowercase."
    },
    {
     "synopsis": "string toupper STRING ?FIRST? ?LAST?",
     "summary": "Gives a string with its letters in uppercase."
    },
    {
     "synopsis": "string totitle STRING ?FIRST? ?LAST?",
     "summary": "Gives a string with its first character in title case and the rest in lowercase."
    },
    {
     "synopsis": "string trim STRING ?CHARS?",
     "summary": "Gives a string with given characters removed at both ends."
    },
    {
     "synopsis": "string trimleft STRING ?CHARS?",
     "summary": "Gives a string with given characters removed at the start."
    },
    {
     "synopsis": "string trimright STRING ?CHARS?",
     "summary": "Gives a string with given characters removed at the end."
    },
    {
     "synopsis": "string is CLASS ?-strict? ?-failindex VAR? STRING",
     "summary": "Tests whether a string is of a class, such as integer or alpha."
    },
    {
     "synopsis": "string cat ?STRING ...?",
     "summary": "Joins strings with no separator."
    },
    {
     "synopsis": "string wordstart STRING INDEX",
     "summary": "Gives the index of the first character of the word at an index."
    },
    {
     "synopsis": "string wordend STRING INDEX",
     "summary": "Gives the index after the last character of the word at an index."
    }
   ],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "string length \"buy milk\"",
     "result": "8"
    },
    {
     "command": "string range \"buy milk\" 4 end",
     "result": "milk"
    },
    {
     "command": "string length -grapheme \"\\U1F1FA\\U1F1F8 é\"",
     "result": "3"
    },
    {
     "command": "string equal [string reverse -grapheme \"aé\"] \"éa\"",
     "result": "1"
    },
    {
     "command": "string map {a 1 b 2} abcab",
     "result": "12c12"
    },
    {
     "command": "string is integer -strict \"\"",
     "result": "0"
    },
    {
     "command": "string first k \"buy milk\"",
     "result": "7"
    },
    {
     "command": "string len abc",
     "result": "3"
    },
    {
     "command": "string length \"buy milk\"",
     "result": "8"
    },
    {
     "command": "string length \"\"",
     "result": "0"
    },
    {
     "command": "string length -grapheme",
     "result": "9"
    },
    {
     "command": "string bytelength \"café\"",
     "result": "5"
    },
    {
     "command": "string bytelength \"\"",
     "result": "0"
    },
    {
     "command": "string insert abc 1 X",
     "result": "aXbc"
    },
    {
     "command": "string insert abc end X",
     "result": "abcX"
    },
    {
     "command": "string insert abc -5 X",
     "result": "Xabc"
    },
    {
     "command": "string insert abc 10 X",
     "result": "abcX"
    },
    {
     "command": "string index abc 1",
     "result": "b"
    },
    {
     "command": "string index abc end-1",
     "result": "b"
    },
    {
     "command": "string index abc 1+1",
     "result": "c"
    },
    {
     "command": "string index abc 5",
     "result": ""
    },
    {
     "command": "string index abc -1",
     "result": ""
    },
    {
     "command": "string range abcdef 1 3",
     "result": "bcd"
    },
    {
     "command": "string range abcdef end-2 end",
     "result": "def"
    },
    {
     "command": "string range abcdef -5 2",
     "result": "abc"
    },
    {
     "command": "string range abcdef 3 1",
     "result": ""
    },
    {
     "command": "string first k \"buy milk\"",
     "result": "7"
    },
    {
     "command": "string first ab xxabab 3",
     "result": "4"
    },
    {
     "command": "string first ab xxabab end-1",
     "result": "4"
    },
    {
     "command": "string first k \"buy milk\" 8",
     "result": "-1"
    },
    {
     "command": "string first \"\" abc",
     "result": "-1"
    },
    {
     "command": "string last ab xxabab",
     "result": "4"
    },
    {
     "command": "string last ab xxabab 3",
     "result": "2"
    },
    {
     "command": "string last ab xxabab 1",
     "result": "-1"
    },
    {
     "command": "string last ab xxabab 100",
     "result": "4"
    },
    {
     "command": "string compare abc abd",
     "result": "-1"
    },
    {
     "command": "string compare abd abc",
     "result": "1"
    },
    {
     "command": "string compare a ab",
     "result": "-1"
    },
    {
     "command": "string compare \"\" a",
     "result": "-1"
    },
    {
     "command": "string equal abc abc",
     "result": "1"
    },
    {
     "command": "string equal 1 1.0",
     "result": "0"
    },
    {
     "command": "string equal \"\" \"\"",
     "result": "1"
    },
    {
     "command": "string match a* abc",
     "result": "1"
    },
    {
     "command": "string match {[a-c]?} bx",
     "result": "1"
    },
    {
     "command": "string match {a\\*} a*",
     "result": "1"
    },
    {
     "command": "string match {[!a]} b",
     "result": "0"
    },
    {
     "command": "string match ? \"\"",
     "result": "0"
    },
    {
     "command": "string map {a 1 b 2} abcab",
     "result": "12c12"
    },
    {
     "command": "string map {abc 1 ab 2 a 3} abcaba",
     "result": "123"
    },
    {
     "command": "string map {ab X a Y} aab",
     "result": "YX"
    },
    {
     "command": "string map {a b b a} ab",
     "result": "ba"
    },
    {
     "command": "string map {a {}} banana",
     "result": "bnn"
    },
    {
     "command": "string repeat ab 3",
     "result": "ababab"
    },
    {
     "command": "string repeat ab 0",
     "result": ""
    },
    {
     "command": "string repeat ab -1",
     "result": ""
    },
    {
     "command": "string replace abcdef 1 3 X",
     "result": "aXef"
    },
    {
     "command": "string replace abcdef 1 3",
     "result": "aef"
    },
    {
     "command": "string replace abcdef end end Z",
     "result": "abcdeZ"
    },
    {
     "command": "string replace abcdef 4 10 X",
     "result": "abcdX"
    },
    {
     "command": "string replace abcdef 3 1 X",
     "result": "abcdef"
    },
    {
     "command": "string reverse abc",
     "result": "cba"
    },
    {
     "command": "string reverse \"\"",
     "result": ""
    },
    {
     "command": "string reverse -grapheme",
     "result": "emehparg-"
    },
    {
     "command": "string tolower ABC",
     "result": "abc"
    },
    {
     "command": "string tolower ABC 1",
     "result": "AbC"
    },
    {
     "command": "string tolower ABCDEF 1 3",
     "result": "AbcdEF"
    },
    {
     "command": "string tolower \"ÀÉÎ\"",
     "result": "àéî"
    },
    {
     "command": "string toupper abc",
     "result": "ABC"
    },
    {
     "command": "string toupper abc 0 0",
     "result": "Abc"
    },
    {
     "command": "string toupper straße",
     "result": "STRAßE"
    },
    {
     "command": "string toupper abc 2 1",
     "result": "abc"
    },
    {
     "command": "string totitle \"hELLO wORLD\"",
     "result": "Hello world"
    },
    {
     "command": "string totitle \"hello world\" 6 end",
     "result": "hello World"
    },
    {
     "command": "string totitle ǆemal",
     "result": "ǅemal"
    },
    {
     "command": "string trim \"  a b  \"",
     "result": "a b"
    },
    {
     "command": "string trim abcXcba abc",
     "result": "X"
    },
    {
     "command": "string trim \" x \"",
     "result": "x"
    },
    {
     "command": "string trim abc \"\"",
     "result": "abc"
    },
    {
     "command": "string trimleft \"  a  \"",
     "result": "a  "
    },
    {
     "command": "string trimleft 0012 0",
     "result": "12"
    },
    {
     "command": "string trimright \"  a  \"",
     "result": "  a"
    },
    {
     "command": "string trimright 1.500 0",
     "result": "1.5"
    },
    {
     "command": "string is integer 12",
     "result": "1"
    },
    {
     "command": "string is digit 12a",
     "result": "0"
    },
    {
     "command": "string is double 1e5",
     "result": "1"
    },
    {
     "command": "string is boolean yes",
     "result": "1"
    },
    {
     "command": "string is list \"a {b\"",
     "result": "0"
    },
    {
     "command": "string cat a b c",
     "result": "abc"
    },
    {
     "command": "string cat {a b} {c d}",
     "result": "a bc d"
    },
    {
     "command": "string cat",
     "result": ""
    },
    {
     "command": "string wordstart \"hello world\" 7",
     "result": "6"
    },
    {
     "command": "string wordstart foo_bar 5",
     "result": "0"
    },
    {
     "command": "string wordstart \"hello world\" 5",
     "result": "5"
    },
    {
     "command": "string wordend \"hello world\" 1",
     "result": "5"
    },
    {
     "command": "string wordend \"hello world\" 5",
     "result": "6"
    },
    {
     "command": "string wordend a.b 1",
     "result": "2"
    },
    {
     "command": "string wordend abc 10",
     "result": "3"
    }
   ],
   "errors": [
    {
     "command": "string length a b",
     "message": "wrong # args: should be \"string length string\""
    },
    {
     "command": "string bytelength",
     "message": "wrong # args: should be \"string bytelength string\""
    },
    {
     "command": "string insert abc x X",
     "message": "bad index \"x\": must be integer?[+-]integer? or end?[+-]integer?"
    },
    {
     "command": "string insert abc 1",
     "message": "wrong # args: should be \"string insert string index insertString\""
    },
    {
     "command": "string index abc foo",
     "message": "bad index \"foo\": must be integer?[+-]integer? or end?[+-]integer?"
    },
    {
     "command": "string index abc",
     "message": "wrong # args: should be \"string index string charIndex\""
    },
    {
     "command": "string range abc 1",
     "message": "wrong # args: should be \"string range string first last\""
    },
    {
     "command": "string range abc x 1",
     "message": "bad index \"x\": must be integer?[+-]integer? or end?[+-]integer?"
    },
    {
     "command": "string first a",
     "message": "wrong # args: should be \"string first needleString haystackString ?startIndex?\""
    },
    {
     "command": "string first k kk x",
     "message": "bad index \"x\": must be integer?[+-]integer? or end?[+-]integer?"
    },
    {
     "command": "string last a",
     "message": "wrong # args: should be \"string last needleString haystackString ?startIndex?\""
    },
    {
     "command": "string last a abc x",
     "message": "bad index \"x\": must be integer?[+-]integer? or end?[+-]integer?"
    },
    {
     "command": "string compare a",
     "message": "wrong # args: should be \"string compare ?-nocase? ?-length int? string1 string2\""
    },
    {
     "command": "string equal a",
     "message": "wrong # args: should be \"string equal ?-nocase? ?-length int? string1 string2\""
    },
    {
     "command": "string match a",
     "message": "wrong # args: should be \"string match ?-nocase? pattern string\""
    },
    {
     "command": "string map {a} abc",
     "message": "char map list unbalanced"
    },
    {
     "command": "string map a",
     "message": "wrong # args: should be \"string map ?-nocase? charMap string\""
    },
    {
     "command": "string map {a 1} abc extra",
     "message": "bad option \"a 1\": must be -nocase"
    },
    {
     "command": "string repeat ab x",
     "message": "expected integer but got \"x\""
    },
    {
     "command": "string repeat a",
     "message": "wrong # args: should be \"string repeat string count\""
    },
    {
     "command": "string replace a",
     "message": "wrong # args: should be \"string replace string first last ?string?\""
    },
    {
     "command": "string replace abc x 1 Z",
     "message": "bad index \"x\": must be integer?[+-]integer? or end?[+-]integer?"
    },
    {
     "command": "string reverse",
     "message": "wrong # args: should be \"string reverse string\""
    },
    {
     "command": "string tolower",
     "message": "wrong # args: should be \"string tolower string ?first? ?last?\""
    },
    {
     "command": "string tolower ABC 1 x",
     "message": "bad index \"x\": must be integer?[+-]integer? or end?[+-]integer?"
    },
    {
     "command": "string toupper",
     "message": "wrong # args: should be \"string toupper string ?first? ?last?\""
    },
    {
     "command": "string totitle abc x",
     "message": "bad index \"x\": must be integer?[+-]integer? or end?[+-]integer?"
    },
    {
     "command": "string totitle",
     "message": "wrong # args: should be \"string totitle string ?first? ?last?\""
    },
    {
     "command": "string trim abc x y",
     "message": "wrong # args: should be \"string trim string ?chars?\""
    },
    {
     "command": "string trimleft",
     "message": "wrong # args: should be \"string trimleft string ?chars?\""
    },
    {
     "command": "string trimright",
     "message": "wrong # args: should be \"string trimright string ?chars?\""
    },
    {
     "command": "string is integer",
     "message": "wrong # args: should be \"string is class ?-strict? ?-failindex var? str\""
    },
    {
     "command": "string wordstart \"hello world\" x",
     "message": "bad index \"x\": must be integer?[+-]integer? or end?[+-]integer?"
    },
    {
     "command": "string wordstart a",
     "message": "wrong # args: should be \"string wordstart string index\""
    },
    {
     "command": "string wordend a",
     "message": "wrong # args: should be \"string wordend string index\""
    }
   ],
   "differences": [
    "Many errors have `-errorcode NONE` in ztcl, where Tcl 8.6.16 and 9.0.4 give a code such as `TCL VALUE INDEX` or `TCL LOOKUP SUBCOMMAND`, and an error of a bad option has the code with no bad word at its end ([issue 658](https://github.com/beetlebugorg/ztcl/issues/658))."
   ],
   "page": "https://beetlebug.org/ztcl/reference/string/"
  },
  {
   "name": "tcl::prefix",
   "area": "strings",
   "synopsis": [
    "tcl::prefix subcommand ?arg ...?"
   ],
   "summary": "Matches a word to a unique prefix of a table, as a command does with its options.",
   "names": [
    "tcl::prefix"
   ],
   "subcommands": [
    {
     "synopsis": "tcl::prefix match ?-exact? ?-message TEXT? ?-error OPTIONS? TABLE STRING",
     "summary": "The entry of TABLE that STRING is a unique prefix of, or an error."
    },
    {
     "synopsis": "tcl::prefix all TABLE STRING",
     "summary": "Each entry that starts with STRING."
    },
    {
     "synopsis": "tcl::prefix longest TABLE STRING",
     "summary": "The longest common prefix of those entries."
    }
   ],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "tcl::prefix match {apple banana} ban",
     "result": "banana"
    },
    {
     "command": "tcl::prefix all {apple apricot banana} ap",
     "result": "apple apricot"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/tcl-prefix/"
  },
  {
   "name": "append",
   "area": "strings",
   "synopsis": [
    "append varName ?value ...?"
   ],
   "summary": "Adds each value to the end of the string in the variable, and gives the new value. It makes the variable when it has no value.",
   "names": [
    "append"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "set s buy; append s \" \" milk",
     "result": "buy milk"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/append/"
  },
  {
   "name": "concat",
   "area": "strings",
   "synopsis": [
    "concat ?arg ...?"
   ],
   "summary": "Joins the arguments with one space, after it removes the white space at the ends of each one. Each argument that is a list stays a list, so `concat` of lists is one flat list.",
   "names": [
    "concat"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "concat {a b} {c d}",
     "result": "a b c d"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/concat/"
  },
  {
   "name": "format",
   "area": "strings",
   "synopsis": [
    "format formatString ?arg ...?"
   ],
   "summary": "Makes a string from a template, as `printf` of C does. `%s` is a string, `%d` an integer, `%f`, `%e`, and `%g` a float, `%x` hexadecimal, `%c` a character from its code, and `%%` a percent sign. A flag such as `-`, `0`, or `+`, a width, and a precision go between `%` and the letter. `%2$s` takes the second argument.",
   "names": [
    "format"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "format \"%-5s|%05.1f\" ab 3.14159",
     "result": "ab   |003.1"
    },
    {
     "command": "format %x 255",
     "result": "ff"
    }
   ],
   "errors": [
    {
     "command": "format %d abc",
     "message": "expected integer but got \"abc\""
    }
   ],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/format/"
  },
  {
   "name": "scan",
   "area": "strings",
   "synopsis": [
    "scan string format ?varName ...?"
   ],
   "summary": "Reads values from a string with a template of `format`. With variables, it sets them and gives the count of values that it read. Without variables, it gives the values as a list.",
   "names": [
    "scan"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "scan \"12 apples\" \"%d %s\"",
     "result": "12 apples"
    },
    {
     "command": "scan \"x=7\" \"x=%d\" n",
     "result": "1"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/scan/"
  },
  {
   "name": "split",
   "area": "strings",
   "synopsis": [
    "split string ?splitChars?",
    "split string splitChars -grapheme"
   ],
   "summary": "Makes a list: it cuts the string at each character of splitChars (white space by default). Two separators in a row give an empty element. An empty splitChars cuts between each character. With `-grapheme`, the unit is the grapheme cluster: an empty splitChars gives each cluster, and a split character cuts only where it is a whole cluster. The form with `-grapheme` needs the module ztcl::text in the build.",
   "names": [
    "split"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "split \"a,b,,c\" ,",
     "result": "a b {} c"
    },
    {
     "command": "split abc \"\"",
     "result": "a b c"
    },
    {
     "command": "llength [split \"e\\u0301x\" \"\" -grapheme]",
     "result": "2"
    }
   ],
   "errors": [],
   "differences": [
    "The form with `-grapheme` is new in ztcl. It has three arguments, so in Tcl it is an error."
   ],
   "page": "https://beetlebug.org/ztcl/reference/split/"
  },
  {
   "name": "join",
   "area": "strings",
   "synopsis": [
    "join list ?joinString?"
   ],
   "summary": "Makes a string of the elements of a list, with joinString (one space by default) between them.",
   "names": [
    "join"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "join {a b c} \", \"",
     "result": "a, b, c"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/join/"
  },
  {
   "name": "regexp",
   "area": "strings",
   "synopsis": [
    "regexp ?-option ...? exp string ?matchVar? ?subMatchVar ...?"
   ],
   "summary": "Finds the regular expression exp in string. It gives 1 for a match and 0 for no match, and sets matchVar to the match and each subMatchVar to a group. Put exp in braces, so that Tcl does not change its backslashes.",
   "names": [
    "regexp"
   ],
   "subcommands": [],
   "options": [
    {
     "option": "-nocase",
     "summary": "Matches letters with no case."
    },
    {
     "option": "-all",
     "summary": "Finds each match. It gives the count of matches."
    },
    {
     "option": "-inline",
     "summary": "Gives the match and its groups as a list, and sets no variable. With `-all`, each match and its groups."
    },
    {
     "option": "-indices",
     "summary": "Gives the start and end index of each match in place of the text."
    },
    {
     "option": "-start INDEX",
     "summary": "Starts the search at INDEX."
    },
    {
     "option": "-line",
     "summary": "`^` and `$` match at each line, and `.` does not match a newline."
    },
    {
     "option": "-expanded",
     "summary": "White space and `#` comments in exp are ignored."
    },
    {
     "option": "-about",
     "summary": "Gives the count of groups and the flags of exp."
    }
   ],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "regexp -inline {(\\d+)-(\\d+)} \"pages 12-40\"",
     "result": "12-40 12 40"
    },
    {
     "command": "regexp -all -inline {#\\w+} \"a #b c #d\"",
     "result": "{#b} #d"
    },
    {
     "command": "regexp {^\\d+$} 42abc",
     "result": "0"
    }
   ],
   "errors": [
    {
     "command": "regexp {(} x",
     "message": "couldn't compile regular expression pattern: parentheses () not balanced"
    }
   ],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/regexp/"
  },
  {
   "name": "regsub",
   "area": "strings",
   "synopsis": [
    "regsub ?-option ...? exp string subSpec ?varName?"
   ],
   "summary": "Replaces the matches of exp in string with subSpec, and gives the new string. In subSpec, `&` and `\\0` are the match, and `\\1` to `\\9` are the groups. With varName, it puts the string in the variable and gives the count of replacements.",
   "names": [
    "regsub"
   ],
   "subcommands": [],
   "options": [
    {
     "option": "-all",
     "summary": "Replaces each match. Without it, only the first."
    },
    {
     "option": "-nocase",
     "summary": "Matches letters with no case."
    },
    {
     "option": "-start INDEX",
     "summary": "Starts the search at INDEX."
    }
   ],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "regsub -all {\\s+} \"a   b  c\" \" \"",
     "result": "a b c"
    },
    {
     "command": "regsub -all {#(\\w+)} \"x #a #b\" {<\\1>}",
     "result": "x <a> <b>"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/regsub/"
  },
  {
   "name": "subst",
   "area": "strings",
   "synopsis": [
    "subst ?-nobackslashes? ?-nocommands? ?-novariables? string"
   ],
   "summary": "Does the substitutions of Tcl on a string: `$name`, `[script]`, and backslashes. A flag turns one of them off. Use it only on text that you trust: `subst` runs each command in brackets.",
   "names": [
    "subst"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "set n 3; subst {n is $n}",
     "result": "n is 3"
    },
    {
     "command": "subst -nocommands {[x] $tcl_platform(engine)}",
     "result": "[x] ztcl"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/subst/"
  },
  {
   "name": "encoding",
   "area": "strings",
   "synopsis": [
    "encoding option ?arg ...?"
   ],
   "summary": "Changes text to bytes and back. ztcl stores text as UTF-8.",
   "names": [
    "encoding"
   ],
   "subcommands": [
    {
     "synopsis": "encoding convertto ?-profile PROFILE? ?-failindex VAR? ENCODING STRING",
     "summary": "The bytes of STRING in ENCODING, as a byte string. The options are in Tcl 9.1 only."
    },
    {
     "synopsis": "encoding convertfrom ?-profile PROFILE? ?-failindex VAR? ENCODING BYTES",
     "summary": "The text of BYTES in ENCODING. In Tcl 9.1 the default profile `strict` makes a bad byte an error, and `-failindex VAR` gives the text before it and puts its index in VAR. The profile `replace` puts U+FFFD for a bad byte, and `tcl8` keeps the behavior of Tcl 8.6. The options are in Tcl 9.1 only."
    },
    {
     "synopsis": "encoding profiles",
     "summary": "The profiles: `replace strict tcl8`. Tcl 9.1 only."
    },
    {
     "synopsis": "encoding user",
     "summary": "The encoding of the user: utf-8. Tcl 9.1 only."
    },
    {
     "synopsis": "encoding names",
     "summary": "The names of the encodings: the ones with no table, and the files of the encoding folders."
    },
    {
     "synopsis": "encoding system",
     "summary": "The encoding of the system: utf-8."
    },
    {
     "synopsis": "encoding dirs ?LIST?",
     "summary": "The folders of the encoding files of Tcl (`koi8-r.enc`, `iso2022-jp.enc`, ...). ztcl reads a file on the first use of its encoding, from these folders. Before a script sets the list, the folder is `$tcl_library/encoding`. The binary has no tables."
    }
   ],
   "options": [],
   "capability": "channels",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "string length [encoding convertto utf-8 é]",
     "result": "2"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/encoding/"
  },
  {
   "name": "binary",
   "area": "strings",
   "synopsis": [
    "binary subcommand ?arg ...?"
   ],
   "summary": "Packs values into bytes and reads values from bytes, with a template of letters such as `c` (8 bits), `s` (16 bits, little endian), `S` (big endian), `i` and `I` (32 bits), `w` and `W` (64 bits), `f` and `d` (floats), `a` (bytes), and `H` (hexadecimal). A count or `*` follows a letter.",
   "names": [
    "binary"
   ],
   "subcommands": [
    {
     "synopsis": "binary format TEMPLATE ?VALUE ...?",
     "summary": "Gives the bytes."
    },
    {
     "synopsis": "binary scan BYTES TEMPLATE ?VAR ...?",
     "summary": "Sets the variables and gives the count of values that it read."
    },
    {
     "synopsis": "binary encode FORMAT ?-option value ...? DATA",
     "summary": "`base64`, `hex`, or `uuencode` text of the bytes."
    },
    {
     "synopsis": "binary decode FORMAT ?-option value ...? DATA",
     "summary": "The bytes of the text."
    }
   ],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "binary encode hex [binary format S 258]",
     "result": "0102"
    },
    {
     "command": "binary scan [binary format c3 {1 2 3}] c* l",
     "result": "1"
    },
    {
     "command": "binary encode base64 hello",
     "result": "aGVsbG8="
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/binary/"
  },
  {
   "name": "tcl_endOfWord",
   "area": "strings",
   "synopsis": [
    "tcl_endOfWord str start"
   ],
   "summary": "The index after the end of the first word that ends after start, or -1. `tcl_startOfNextWord`, `tcl_startOfPreviousWord`, `tcl_wordBreakAfter`, and `tcl_wordBreakBefore` find the other edges of words. A word is a run of letters, digits, and underscores.",
   "names": [
    "tcl_endOfWord",
    "tcl_startOfNextWord",
    "tcl_startOfPreviousWord",
    "tcl_wordBreakAfter",
    "tcl_wordBreakBefore"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "tcl_endOfWord \"buy milk\" 0",
     "result": "3"
    },
    {
     "command": "tcl_startOfNextWord \"buy milk\" 0",
     "result": "4"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/tcl_endOfWord/"
  },
  {
   "name": "foreach",
   "area": "lists",
   "synopsis": [
    "foreach VARLIST LIST ?VARLIST LIST ...? BODY"
   ],
   "summary": "Runs a script for each element of one or more lists.",
   "names": [
    "foreach"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "foreach x {1 2} {set x}",
     "result": ""
    }
   ],
   "errors": [
    {
     "command": "foreach {} {1} {}",
     "message": "foreach varlist is empty"
    },
    {
     "command": "foreach x {1 2} {error boom}",
     "message": "boom"
    },
    {
     "command": "foreach x {1}",
     "message": "wrong # args: should be \"foreach varList list ?varList list ...? command\""
    }
   ],
   "differences": [
    "An empty VARLIST has `-errorcode NONE`, where Tcl 8.6.16 and 9.0.4 give `TCL OPERATION FOREACH NEEDVARS` ([issue 658](https://github.com/beetlebugorg/ztcl/issues/658))."
   ],
   "page": "https://beetlebug.org/ztcl/reference/foreach/"
  },
  {
   "name": "lappend",
   "area": "lists",
   "synopsis": [
    "lappend VAR ?VALUE ...?"
   ],
   "summary": "Adds values as elements to the end of the list in a variable.",
   "names": [
    "lappend"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [
    {
     "command": "lappend",
     "message": "wrong # args: should be \"lappend varName ?value ...?\""
    }
   ],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/lappend/"
  },
  {
   "name": "lassign",
   "area": "lists",
   "synopsis": [
    "lassign LIST ?VAR ...?"
   ],
   "summary": "Puts the elements of a list in variables, and gives the elements that are left.",
   "names": [
    "lassign"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "lassign {1 2 3} a b",
     "result": "3"
    },
    {
     "command": "lassign {1 2}",
     "result": "1 2"
    }
   ],
   "errors": [
    {
     "command": "lassign \"a {b\" x",
     "message": "unmatched open brace in list"
    },
    {
     "command": "lassign",
     "message": "wrong # args: should be \"lassign list ?varName ...?\""
    }
   ],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/lassign/"
  },
  {
   "name": "ledit",
   "area": "lists",
   "synopsis": [
    "ledit VAR FIRST LAST ?ELEMENT ...?"
   ],
   "summary": "Replaces a range of elements of the list in a variable.",
   "names": [
    "ledit"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": "9.1",
   "compute": "1 for the call",
   "examples": [],
   "errors": [
    {
     "command": "ledit l 0",
     "message": "wrong # args: should be \"ledit listVar first last ?element ...?\""
    }
   ],
   "differences": [
    "A bad index and a variable with no value have `-errorcode NONE`, where Tcl 9.0.4 gives `TCL VALUE INDEX` and `TCL LOOKUP VARNAME` ([issue 658](https://github.com/beetlebugorg/ztcl/issues/658))."
   ],
   "page": "https://beetlebug.org/ztcl/reference/ledit/"
  },
  {
   "name": "lfilter",
   "area": "lists",
   "synopsis": [
    "lfilter VARLIST LIST ?VARLIST LIST ...? SCRIPT"
   ],
   "summary": "Gives the elements of a list for which a script gives true.",
   "names": [
    "lfilter"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": "9.1",
   "compute": "1 for the call",
   "examples": [
    {
     "command": "lfilter x {1 2 3 4} {expr {$x % 2 == 0}}",
     "result": "2 4"
    },
    {
     "command": "lfilter {a b} {1 2 3 4} {expr {$b > 2}}",
     "result": "3"
    },
    {
     "command": "lfilter x {1 2} y {3 4} {expr {$y > 3}}",
     "result": "2"
    },
    {
     "command": "lfilter x {1 2 3} {if {$x == 2} continue; expr 1}",
     "result": "1 3"
    },
    {
     "command": "lfilter x {} {expr 1}",
     "result": ""
    }
   ],
   "errors": [
    {
     "command": "lfilter x {1 2} {expr {\"x\"}}",
     "message": "expected boolean value but got \"x\""
    },
    {
     "command": "lfilter {} {1} {expr 1}",
     "message": "lfilter varlist is empty"
    },
    {
     "command": "lfilter x {1}",
     "message": "wrong # args: should be \"lfilter varList list ?varList list ...? command\""
    }
   ],
   "differences": [
    "Tcl 9.0.4 has no `lfilter`."
   ],
   "page": "https://beetlebug.org/ztcl/reference/lfilter/"
  },
  {
   "name": "lindex",
   "area": "lists",
   "synopsis": [
    "lindex LIST ?INDEX ...?"
   ],
   "summary": "Gives the element of a list at an index, or at a path of indexes into nested lists.",
   "names": [
    "lindex"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "lindex {a b c} end",
     "result": "c"
    },
    {
     "command": "lindex {a b c} end-1",
     "result": "b"
    },
    {
     "command": "lindex {{a b} {c d}} 1 0",
     "result": "c"
    },
    {
     "command": "lindex {{a b} {c d}} {1 0}",
     "result": "c"
    },
    {
     "command": "lindex {a b c} 5",
     "result": ""
    },
    {
     "command": "lindex {a b c}",
     "result": "a b c"
    },
    {
     "command": "lindex {a b} 0 0 0",
     "result": "a"
    }
   ],
   "errors": [
    {
     "command": "lindex {a b c} x",
     "message": "bad index \"x\": must be integer?[+-]integer? or end?[+-]integer?"
    },
    {
     "command": "lindex \"a {b\" 0",
     "message": "unmatched open brace in list"
    }
   ],
   "differences": [
    "A bad index has `-errorcode NONE`, where Tcl 8.6.16 and 9.0.4 give `TCL VALUE INDEX` ([issue 658](https://github.com/beetlebugorg/ztcl/issues/658))."
   ],
   "page": "https://beetlebug.org/ztcl/reference/lindex/"
  },
  {
   "name": "linsert",
   "area": "lists",
   "synopsis": [
    "linsert LIST INDEX ?ELEMENT ...?"
   ],
   "summary": "Gives a list with elements put in before an index.",
   "names": [
    "linsert"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "linsert {a d} 1 b c",
     "result": "a b c d"
    },
    {
     "command": "linsert {a b} end x",
     "result": "a b x"
    },
    {
     "command": "linsert {a b} end+5 x",
     "result": "a b x"
    },
    {
     "command": "linsert {a b} -3 x",
     "result": "x a b"
    },
    {
     "command": "linsert {a b} 1",
     "result": "a b"
    }
   ],
   "errors": [
    {
     "command": "linsert {a b} x y",
     "message": "bad index \"x\": must be integer?[+-]integer? or end?[+-]integer?"
    },
    {
     "command": "linsert {a b}",
     "message": "wrong # args: should be \"linsert list index ?element ...?\""
    }
   ],
   "differences": [
    "A bad index has `-errorcode NONE`, where Tcl 8.6.16 and 9.0.4 give `TCL VALUE INDEX` ([issue 658](https://github.com/beetlebugorg/ztcl/issues/658))."
   ],
   "page": "https://beetlebug.org/ztcl/reference/linsert/"
  },
  {
   "name": "list",
   "area": "lists",
   "synopsis": [
    "list ?ARG ...?"
   ],
   "summary": "Makes a list with each argument as one element.",
   "names": [
    "list"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "list a \"b c\" {}",
     "result": "a {b c} {}"
    },
    {
     "command": "list",
     "result": ""
    },
    {
     "command": "list \"a{b\" \"c}\" {$x} \"#x\"",
     "result": "a\\{b c\\} {$x} #x"
    },
    {
     "command": "llength [list \"a b\" c]",
     "result": "2"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/list/"
  },
  {
   "name": "llength",
   "area": "lists",
   "synopsis": [
    "llength LIST"
   ],
   "summary": "Gives the count of elements of a list.",
   "names": [
    "llength"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "llength {a {b c} d}",
     "result": "3"
    },
    {
     "command": "llength {}",
     "result": "0"
    },
    {
     "command": "llength \"  a   b  \"",
     "result": "2"
    }
   ],
   "errors": [
    {
     "command": "llength \"a {b\"",
     "message": "unmatched open brace in list"
    },
    {
     "command": "llength a b",
     "message": "wrong # args: should be \"llength list\""
    }
   ],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/llength/"
  },
  {
   "name": "lmap",
   "area": "lists",
   "synopsis": [
    "lmap VARLIST LIST ?VARLIST LIST ...? BODY"
   ],
   "summary": "Runs a script for each element of one or more lists, and gives a list of the results.",
   "names": [
    "lmap"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "lmap x {1 2 3} {expr {$x * $x}}",
     "result": "1 4 9"
    },
    {
     "command": "lmap x {1 2 3 4} {if {$x % 2} continue; set x}",
     "result": "2 4"
    },
    {
     "command": "lmap x {1 2 3 4} {if {$x == 3} break; set x}",
     "result": "1 2"
    },
    {
     "command": "lmap {a b} {1 2 3 4 5} {list $a $b}",
     "result": "{1 2} {3 4} {5 {}}"
    },
    {
     "command": "lmap x {1 2} y {a b c} {list $x $y}",
     "result": "{1 a} {2 b} {{} c}"
    },
    {
     "command": "lmap x {1 2} {}",
     "result": "{} {}"
    }
   ],
   "errors": [
    {
     "command": "lmap {} {1} {set x}",
     "message": "lmap varlist is empty"
    },
    {
     "command": "lmap x {1 2} {error oops}",
     "message": "oops"
    },
    {
     "command": "lmap x {1}",
     "message": "wrong # args: should be \"lmap varList list ?varList list ...? command\""
    }
   ],
   "differences": [
    "An empty VARLIST has `-errorcode NONE`, where Tcl 8.6.16 and 9.0.4 give `TCL OPERATION LMAP NEEDVARS` ([issue 658](https://github.com/beetlebugorg/ztcl/issues/658))."
   ],
   "page": "https://beetlebug.org/ztcl/reference/lmap/"
  },
  {
   "name": "lpop",
   "area": "lists",
   "synopsis": [
    "lpop VAR ?INDEX ...?"
   ],
   "summary": "Removes an element from the list in a variable and gives it.",
   "names": [
    "lpop"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": "9.1",
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [
    "Tcl 9.0.4 names the variable `listvar` in its message of a wrong count of arguments ([issue 676](https://github.com/beetlebugorg/ztcl/issues/676)).",
    "A bad index and a variable with no value have `-errorcode NONE`, where Tcl 9.0.4 gives `TCL VALUE INDEX` and `TCL LOOKUP VARNAME` ([issue 658](https://github.com/beetlebugorg/ztcl/issues/658))."
   ],
   "page": "https://beetlebug.org/ztcl/reference/lpop/"
  },
  {
   "name": "lrange",
   "area": "lists",
   "synopsis": [
    "lrange LIST FIRST LAST"
   ],
   "summary": "Gives the elements of a list from one index to another, as a list.",
   "names": [
    "lrange"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "lrange {a b c d} 1 end-1",
     "result": "b c"
    },
    {
     "command": "lrange {a b c d} -3 1",
     "result": "a b"
    },
    {
     "command": "lrange {a b c d} 2 99",
     "result": "c d"
    },
    {
     "command": "lrange {a b c d} 2 1",
     "result": ""
    },
    {
     "command": "lrange {a {b c} d} 1 1",
     "result": "{b c}"
    }
   ],
   "errors": [
    {
     "command": "lrange {a b} x 1",
     "message": "bad index \"x\": must be integer?[+-]integer? or end?[+-]integer?"
    },
    {
     "command": "lrange {a b} 0",
     "message": "wrong # args: should be \"lrange list first last\""
    }
   ],
   "differences": [
    "A bad index has `-errorcode NONE`, where Tcl 8.6.16 and 9.0.4 give `TCL VALUE INDEX` ([issue 658](https://github.com/beetlebugorg/ztcl/issues/658))."
   ],
   "page": "https://beetlebug.org/ztcl/reference/lrange/"
  },
  {
   "name": "lremove",
   "area": "lists",
   "synopsis": [
    "lremove LIST ?INDEX ...?"
   ],
   "summary": "Gives a list with the elements at some indexes removed.",
   "names": [
    "lremove"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": "9.1",
   "compute": "1 for the call",
   "examples": [
    {
     "command": "lremove {a b c d} 1 end",
     "result": "a c"
    },
    {
     "command": "lremove {a b c d} end-1 0",
     "result": "b d"
    },
    {
     "command": "lremove {a b c d} 1 1",
     "result": "a c d"
    },
    {
     "command": "lremove {a b c d} 5",
     "result": "a b c d"
    },
    {
     "command": "lremove {a b c d}",
     "result": "a b c d"
    }
   ],
   "errors": [
    {
     "command": "lremove {a b} x",
     "message": "bad index \"x\": must be integer?[+-]integer? or end?[+-]integer?"
    },
    {
     "command": "lremove",
     "message": "wrong # args: should be \"lremove list ?index ...?\""
    }
   ],
   "differences": [
    "A bad index has `-errorcode NONE`, where Tcl 9.0.4 gives `TCL VALUE INDEX` ([issue 658](https://github.com/beetlebugorg/ztcl/issues/658))."
   ],
   "page": "https://beetlebug.org/ztcl/reference/lremove/"
  },
  {
   "name": "lrepeat",
   "area": "lists",
   "synopsis": [
    "lrepeat COUNT ?ELEMENT ...?"
   ],
   "summary": "Makes a list with the same elements repeated a number of times.",
   "names": [
    "lrepeat"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "lrepeat 3 a b",
     "result": "a b a b a b"
    },
    {
     "command": "lrepeat 2 {a b}",
     "result": "{a b} {a b}"
    },
    {
     "command": "lrepeat 0 a",
     "result": ""
    }
   ],
   "errors": [
    {
     "command": "lrepeat -1 a",
     "message": "bad count \"-1\": must be integer >= 0"
    },
    {
     "command": "lrepeat x a",
     "message": "expected integer but got \"x\""
    }
   ],
   "differences": [
    "The errors have `-errorcode NONE`, where Tcl 8.6.16 and 9.0.4 give `TCL OPERATION LREPEAT NEGARG` and `TCL VALUE NUMBER` ([issue 658](https://github.com/beetlebugorg/ztcl/issues/658))."
   ],
   "page": "https://beetlebug.org/ztcl/reference/lrepeat/"
  },
  {
   "name": "lreplace",
   "area": "lists",
   "synopsis": [
    "lreplace LIST FIRST LAST ?ELEMENT ...?"
   ],
   "summary": "Gives a list with a range of elements replaced by new elements.",
   "names": [
    "lreplace"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "lreplace {a b c d} 1 2 x",
     "result": "a x d"
    },
    {
     "command": "lreplace {a b c d} 1 2",
     "result": "a d"
    },
    {
     "command": "lreplace {a b c d} 2 1 x",
     "result": "a b x c d"
    },
    {
     "command": "lreplace {a b c d} 3 10 x",
     "result": "a b c x"
    },
    {
     "command": "lreplace {a b} 5 6 x",
     "result": "a b x"
    }
   ],
   "errors": [
    {
     "command": "lreplace {a b} x 1",
     "message": "bad index \"x\": must be integer?[+-]integer? or end?[+-]integer?"
    },
    {
     "command": "lreplace {a b} 0",
     "message": "wrong # args: should be \"lreplace list first last ?element ...?\""
    }
   ],
   "differences": [
    "A bad index has `-errorcode NONE`, where Tcl 8.6.16 and 9.0.4 give `TCL VALUE INDEX` ([issue 658](https://github.com/beetlebugorg/ztcl/issues/658))."
   ],
   "page": "https://beetlebug.org/ztcl/reference/lreplace/"
  },
  {
   "name": "lreverse",
   "area": "lists",
   "synopsis": [
    "lreverse LIST"
   ],
   "summary": "Gives the elements of a list in the reverse order.",
   "names": [
    "lreverse"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "lreverse {a b c}",
     "result": "c b a"
    },
    {
     "command": "lreverse {a {b c}}",
     "result": "{b c} a"
    },
    {
     "command": "lreverse {}",
     "result": ""
    }
   ],
   "errors": [
    {
     "command": "lreverse \"a {b\"",
     "message": "unmatched open brace in list"
    },
    {
     "command": "lreverse",
     "message": "wrong # args: should be \"lreverse list\""
    }
   ],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/lreverse/"
  },
  {
   "name": "lsearch",
   "area": "lists",
   "synopsis": [
    "lsearch ?OPTION ...? LIST PATTERN"
   ],
   "summary": "Finds the elements of a list that match a pattern.",
   "names": [
    "lsearch"
   ],
   "subcommands": [],
   "options": [
    {
     "option": "-glob",
     "summary": "Matches PATTERN as a glob pattern; the default."
    },
    {
     "option": "-exact",
     "summary": "Matches an element that equals PATTERN."
    },
    {
     "option": "-regexp",
     "summary": "Matches PATTERN as a regular expression."
    },
    {
     "option": "-sorted",
     "summary": "Searches a sorted list with a binary search."
    },
    {
     "option": "-bisect",
     "summary": "Gives the index of the last element at or before PATTERN in a sorted list."
    },
    {
     "option": "-all",
     "summary": "Gives each match in place of the first one."
    },
    {
     "option": "-inline",
     "summary": "Gives the matching elements in place of their indexes."
    },
    {
     "option": "-not",
     "summary": "Finds the elements that do not match."
    },
    {
     "option": "-start INDEX",
     "summary": "Starts the search at an index."
    },
    {
     "option": "-ascii",
     "summary": "Compares the elements as text; the default type."
    },
    {
     "option": "-dictionary",
     "summary": "Compares the elements in dictionary order."
    },
    {
     "option": "-integer",
     "summary": "Compares the elements as integers."
    },
    {
     "option": "-real",
     "summary": "Compares the elements as floating-point numbers."
    },
    {
     "option": "-nocase",
     "summary": "Matches letters with no regard to case."
    },
    {
     "option": "-increasing",
     "summary": "Says that a sorted list is in increasing order; the default."
    },
    {
     "option": "-decreasing",
     "summary": "Says that a sorted list is in decreasing order."
    },
    {
     "option": "-index INDEX",
     "summary": "Compares an element of each element in place of the whole element."
    },
    {
     "option": "-subindices",
     "summary": "With -index, gives the path of the match or the subelement."
    },
    {
     "option": "-stride N",
     "summary": "Reads the list as groups of N elements."
    }
   ],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "lsearch {a b c} c",
     "result": "2"
    },
    {
     "command": "lsearch {a b c} z",
     "result": "-1"
    },
    {
     "command": "lsearch {apple box ant} a*",
     "result": "0"
    },
    {
     "command": "lsearch -all -inline {apple box ant} a*",
     "result": "apple ant"
    },
    {
     "command": "lsearch -index 0 {{x 1} {y 2}} y",
     "result": "1"
    },
    {
     "command": "lsearch -exact -all -inline -not {a b c b} b",
     "result": "a c"
    }
   ],
   "errors": [
    {
     "command": "lsearch {a}",
     "message": "wrong # args: should be \"lsearch ?-option value ...? list pattern\""
    },
    {
     "command": "lsearch \"a {b\" a",
     "message": "unmatched open brace in list"
    }
   ],
   "differences": [
    "Most errors have `-errorcode NONE`, where Tcl 8.6.16 and 9.0.4 give a code such as `TCL LOOKUP INDEX option` or `TCL VALUE INDEX` ([issue 658](https://github.com/beetlebugorg/ztcl/issues/658)).",
    "In Tcl 9.0.4 the message of a bad regular expression starts with `cannot compile` ([issue 668](https://github.com/beetlebugorg/ztcl/issues/668))."
   ],
   "page": "https://beetlebug.org/ztcl/reference/lsearch/"
  },
  {
   "name": "lseq",
   "area": "lists",
   "synopsis": [
    "lseq COUNT",
    "lseq START ?to|..? END ??by? STEP?",
    "lseq START count COUNT ??by? STEP?"
   ],
   "summary": "Makes a list of numbers in an arithmetic series.",
   "names": [
    "lseq"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": "9.1",
   "compute": "1 for the call",
   "examples": [
    {
     "command": "lseq 5",
     "result": "0 1 2 3 4"
    },
    {
     "command": "lseq 1 5",
     "result": "1 2 3 4 5"
    },
    {
     "command": "lseq 5 1",
     "result": "5 4 3 2 1"
    },
    {
     "command": "lseq 1 to 9 by 3",
     "result": "1 4 7"
    },
    {
     "command": "lseq 1 .. 4",
     "result": "1 2 3 4"
    },
    {
     "command": "lseq 10 count 3",
     "result": "10 11 12"
    },
    {
     "command": "lseq 10 count 3 by 2",
     "result": "10 12 14"
    },
    {
     "command": "lseq 0 1 0.25",
     "result": "0.0 0.25 0.5 0.75 1.0"
    },
    {
     "command": "lseq 0 1 by 0.3",
     "result": "0.0 0.3 0.6 0.9"
    },
    {
     "command": "lseq 1 10 -1",
     "result": ""
    },
    {
     "command": "lseq 0x10 0x12",
     "result": "16 17 18"
    }
   ],
   "errors": [
    {
     "command": "lseq x",
     "message": "expected number but got \"x\""
    },
    {
     "command": "lseq 1+1",
     "message": "expected number but got \"1+1\""
    },
    {
     "command": "lseq 1 to",
     "message": "missing \"to\" value."
    },
    {
     "command": "lseq 1 2 3 4 5",
     "message": "wrong # args: should be \"lseq n ??op? n ??by? n??\""
    }
   ],
   "differences": [
    "tclsh 9.1 makes a list that computes each element when a script reads it, so a long series uses little memory. ztcl makes the whole list, with the list limit of `lrepeat`."
   ],
   "page": "https://beetlebug.org/ztcl/reference/lseq/"
  },
  {
   "name": "lset",
   "area": "lists",
   "synopsis": [
    "lset VAR ?INDEX ...? VALUE"
   ],
   "summary": "Sets one element of the list in a variable, also in nested lists.",
   "names": [
    "lset"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [
    {
     "command": "lset",
     "message": "wrong # args: should be \"lset listVar ?index? ?index ...? value\""
    }
   ],
   "differences": [
    "An index out of range has `-errorcode NONE`, where Tcl 8.6.16 gives `TCL OPERATION LSET BADINDEX` and Tcl 9.0.4 gives `TCL VALUE INDEX OUTOFRANGE` ([issue 658](https://github.com/beetlebugorg/ztcl/issues/658)).",
    "In Tcl 9.0.4 the message of an index out of range names the index: `index \"5\" out of range` ([issue 665](https://github.com/beetlebugorg/ztcl/issues/665))."
   ],
   "page": "https://beetlebug.org/ztcl/reference/lset/"
  },
  {
   "name": "lsort",
   "area": "lists",
   "synopsis": [
    "lsort ?OPTION ...? LIST"
   ],
   "summary": "Gives a sorted copy of a list.",
   "names": [
    "lsort"
   ],
   "subcommands": [],
   "options": [
    {
     "option": "-ascii",
     "summary": "Compares the elements as text; the default type."
    },
    {
     "option": "-dictionary",
     "summary": "Compares the elements in dictionary order: no case, and runs of digits as numbers."
    },
    {
     "option": "-integer",
     "summary": "Compares the elements as integers."
    },
    {
     "option": "-real",
     "summary": "Compares the elements as floating-point numbers."
    },
    {
     "option": "-command SCRIPT",
     "summary": "Compares two elements with a command."
    },
    {
     "option": "-increasing",
     "summary": "Sorts from the smallest element to the largest; the default."
    },
    {
     "option": "-decreasing",
     "summary": "Sorts from the largest element to the smallest."
    },
    {
     "option": "-nocase",
     "summary": "Compares the text with no regard to case."
    },
    {
     "option": "-unique",
     "summary": "Keeps one element of each group of equal elements."
    },
    {
     "option": "-indices",
     "summary": "Gives the indexes of the elements in sorted order."
    },
    {
     "option": "-index INDEX",
     "summary": "Compares an element of each element in place of the whole element."
    },
    {
     "option": "-stride N",
     "summary": "Sorts groups of N elements."
    }
   ],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "lsort {pear apple fig}",
     "result": "apple fig pear"
    },
    {
     "command": "lsort {10 9 100}",
     "result": "10 100 9"
    },
    {
     "command": "lsort -integer {10 9 100}",
     "result": "9 10 100"
    },
    {
     "command": "lsort -dictionary {a10 a2 A1}",
     "result": "A1 a2 a10"
    },
    {
     "command": "lsort -index 1 -decreasing {{a 1} {b 3} {c 2}}",
     "result": "{b 3} {c 2} {a 1}"
    }
   ],
   "errors": [
    {
     "command": "lsort",
     "message": "wrong # args: should be \"lsort ?-option value ...? list\""
    },
    {
     "command": "lsort -bogus {a}",
     "message": "bad option \"-bogus\": must be -ascii, -command, -decreasing, -dictionary, -increasing, -index, -indices, -integer, -nocase, -real, -stride, or -unique"
    },
    {
     "command": "lsort \"a {b\"",
     "message": "unmatched open brace in list"
    }
   ],
   "differences": [
    "Most errors have `-errorcode NONE`, where Tcl 8.6.16 and 9.0.4 give a code such as `TCL LOOKUP INDEX option` or `TCL OPERATION LSORT INDEXFAILED` ([issue 658](https://github.com/beetlebugorg/ztcl/issues/658))."
   ],
   "page": "https://beetlebug.org/ztcl/reference/lsort/"
  },
  {
   "name": "dict",
   "area": "dicts",
   "synopsis": [
    "dict SUBCOMMAND ?ARG ...?"
   ],
   "summary": "The commands for dicts: lists of keys and values with each key once.",
   "names": [
    "dict"
   ],
   "subcommands": [
    {
     "synopsis": "dict create ?KEY VALUE ...?",
     "summary": "Makes a dict from keys and values."
    },
    {
     "synopsis": "dict get DICT ?KEY ...?",
     "summary": "Gives the value at a path of keys."
    },
    {
     "synopsis": "dict getdef DICT ?KEY ...? KEY DEFAULT",
     "summary": "Gives the value at a path of keys, or a default when a key is missing. Tcl 9.1 only."
    },
    {
     "synopsis": "dict getwithdefault DICT ?KEY ...? KEY DEFAULT",
     "summary": "Gives the value at a path of keys, or a default: the same command as dict getdef. Tcl 9.1 only."
    },
    {
     "synopsis": "dict exists DICT KEY ?KEY ...?",
     "summary": "Tests whether a path of keys exists."
    },
    {
     "synopsis": "dict set VAR KEY ?KEY ...? VALUE",
     "summary": "Sets the value at a path of keys in the dict of a variable."
    },
    {
     "synopsis": "dict unset VAR KEY ?KEY ...?",
     "summary": "Removes the key at the end of a path from the dict of a variable."
    },
    {
     "synopsis": "dict keys DICT ?PATTERN?",
     "summary": "Gives the keys of a dict, or the keys that match a glob pattern."
    },
    {
     "synopsis": "dict values DICT ?PATTERN?",
     "summary": "Gives the values of a dict, or the values that match a glob pattern."
    },
    {
     "synopsis": "dict size DICT",
     "summary": "Gives the count of keys of a dict."
    },
    {
     "synopsis": "dict for {KEYVAR VALUEVAR} DICT BODY",
     "summary": "Runs a script for each key and value of a dict."
    },
    {
     "synopsis": "dict map {KEYVAR VALUEVAR} DICT BODY",
     "summary": "Makes a dict with the same keys and the results of a script as values."
    },
    {
     "synopsis": "dict filter DICT key ?PATTERN ...?",
     "summary": "Gives the keys and values of a dict that pass a test."
    },
    {
     "synopsis": "dict filter DICT value ?PATTERN ...?",
     "summary": "Gives the keys and values of a dict that pass a test."
    },
    {
     "synopsis": "dict filter DICT script {KEYVAR VALUEVAR} BODY",
     "summary": "Gives the keys and values of a dict that pass a test."
    },
    {
     "synopsis": "dict merge ?DICT ...?",
     "summary": "Joins dicts into one, with the value of a later dict for a key in both."
    },
    {
     "synopsis": "dict remove DICT ?KEY ...?",
     "summary": "Gives a copy of a dict with some keys removed."
    },
    {
     "synopsis": "dict replace DICT ?KEY VALUE ...?",
     "summary": "Gives a copy of a dict with new values for some keys."
    },
    {
     "synopsis": "dict incr VAR KEY ?INCREMENT?",
     "summary": "Adds an integer to the value of a key in the dict of a variable."
    },
    {
     "synopsis": "dict append VAR KEY ?STRING ...?",
     "summary": "Adds text to the end of the value of a key in the dict of a variable."
    },
    {
     "synopsis": "dict lappend VAR KEY ?VALUE ...?",
     "summary": "Adds elements to the list value of a key in the dict of a variable."
    },
    {
     "synopsis": "dict update VAR KEY VARNAME ?KEY VARNAME ...? BODY",
     "summary": "Runs a script with variables linked to keys of the dict of a variable."
    },
    {
     "synopsis": "dict with VAR ?KEY ...? BODY",
     "summary": "Runs a script with a variable for each key of the dict of a variable."
    },
    {
     "synopsis": "dict info DICT",
     "summary": "Gives text for people with the count of entries of a dict."
    }
   ],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "set d [dict create text milk done 0]",
     "result": "text milk done 0"
    },
    {
     "command": "dict get $d text",
     "result": "milk"
    },
    {
     "command": "dict set d done 1",
     "result": "text milk done 1"
    },
    {
     "command": "dict exists $d tags",
     "result": "0"
    },
    {
     "command": "dict merge {a 1 b 2} {b 3}",
     "result": "a 1 b 3"
    },
    {
     "command": "dict filter {a 1 b 2 c 3} value {[13]}",
     "result": "a 1 c 3"
    },
    {
     "command": "dict create a 1 b 2",
     "result": "a 1 b 2"
    },
    {
     "command": "dict create a 1 b 2 a 3",
     "result": "a 3 b 2"
    },
    {
     "command": "dict create",
     "result": ""
    },
    {
     "command": "dict create {} x",
     "result": "{} x"
    },
    {
     "command": "dict get {a 1 b 2} b",
     "result": "2"
    },
    {
     "command": "dict get {a {x 9}} a x",
     "result": "9"
    },
    {
     "command": "dict get {a 1 b 2}",
     "result": "a 1 b 2"
    },
    {
     "command": "dict getdef {a 1} b 9",
     "result": "9"
    },
    {
     "command": "dict getdef {a 1} a 9",
     "result": "1"
    },
    {
     "command": "dict getdef {a {b 2}} a c 0",
     "result": "0"
    },
    {
     "command": "dict getdef {} a b 1",
     "result": "1"
    },
    {
     "command": "dict getwithdefault {a 1} b 9",
     "result": "9"
    },
    {
     "command": "dict exists {a 1} a",
     "result": "1"
    },
    {
     "command": "dict exists {a {b 2}} a b",
     "result": "1"
    },
    {
     "command": "dict exists {a 1} a b",
     "result": "0"
    },
    {
     "command": "dict exists {a 1 b} a",
     "result": "0"
    },
    {
     "command": "dict keys {a 1 b 2 ab 3}",
     "result": "a b ab"
    },
    {
     "command": "dict keys {a 1 b 2 ab 3} a*",
     "result": "a ab"
    },
    {
     "command": "dict keys {}",
     "result": ""
    },
    {
     "command": "dict values {a 1 b 2 c 12}",
     "result": "1 2 12"
    },
    {
     "command": "dict values {a 1 b 2 c 12} 1*",
     "result": "1 12"
    },
    {
     "command": "dict size {a 1 b 2}",
     "result": "2"
    },
    {
     "command": "dict size {a 1 a 2}",
     "result": "1"
    },
    {
     "command": "dict size {}",
     "result": "0"
    },
    {
     "command": "dict map {k v} {a 1 b 2} {expr {$v * 10}}",
     "result": "a 10 b 20"
    },
    {
     "command": "dict map {k v} {a 1 b 2 c 3} {if {$k eq \"b\"} continue; set v}",
     "result": "a 1 c 3"
    },
    {
     "command": "dict map {k v} {a 1 b 2 c 3} {if {$k eq \"b\"} break; set v}",
     "result": ""
    },
    {
     "command": "dict map {k v} {a 1} {set k z; set v}",
     "result": "a 1"
    },
    {
     "command": "dict filter {a 1 b 2 ab 3} key a*",
     "result": "a 1 ab 3"
    },
    {
     "command": "dict filter {a 1 b 2 ab 3} key a* b",
     "result": "a 1 b 2 ab 3"
    },
    {
     "command": "dict filter {a 1 b 2 c 3} value {[13]}",
     "result": "a 1 c 3"
    },
    {
     "command": "dict filter {a 1 b 2 c 3} script {k v} {expr {$v > 1}}",
     "result": "b 2 c 3"
    },
    {
     "command": "dict filter {a 1 b 2 c 3} script {k v} {if {$v == 2} break; expr 1}",
     "result": "a 1"
    },
    {
     "command": "dict merge {a 1 b 2} {b 3 c 4}",
     "result": "a 1 b 3 c 4"
    },
    {
     "command": "dict merge {a {x 1}} {a {y 2}}",
     "result": "a {y 2}"
    },
    {
     "command": "dict merge",
     "result": ""
    },
    {
     "command": "dict remove {a 1 b 2 c 3} a c",
     "result": "b 2"
    },
    {
     "command": "dict remove {a 1} zz",
     "result": "a 1"
    },
    {
     "command": "dict replace {a 1 b 2} b 3 c 4",
     "result": "a 1 b 3 c 4"
    },
    {
     "command": "dict replace {} a 1",
     "result": "a 1"
    },
    {
     "command": "dict info {a 1 b 2}",
     "result": "2 entries in table"
    },
    {
     "command": "dict info {}",
     "result": "0 entries in table"
    }
   ],
   "errors": [
    {
     "command": "dict get {a 1} b",
     "message": "key \"b\" not known in dictionary"
    },
    {
     "command": "dict size \"a \\{\"",
     "message": "unmatched open brace in dict"
    },
    {
     "command": "dict create a",
     "message": "wrong # args: should be \"dict create ?key value ...?\""
    },
    {
     "command": "dict get {a 1} b",
     "message": "key \"b\" not known in dictionary"
    },
    {
     "command": "dict get {a 1} a x",
     "message": "missing value to go with key"
    },
    {
     "command": "dict get",
     "message": "wrong # args: should be \"dict get dictionary ?key ...?\""
    },
    {
     "command": "dict getdef {a 1} a x 0",
     "message": "missing value to go with key"
    },
    {
     "command": "dict getdef {a 1} b",
     "message": "wrong # args: should be \"dict getdef dictionary ?key ...? key default\""
    },
    {
     "command": "dict getwithdefault {a 1}",
     "message": "wrong # args: should be \"dict getwithdefault dictionary ?key ...? key default\""
    },
    {
     "command": "dict exists {a 1}",
     "message": "wrong # args: should be \"dict exists dictionary key ?key ...?\""
    },
    {
     "command": "dict set d a",
     "message": "wrong # args: should be \"dict set dictVarName key ?key ...? value\""
    },
    {
     "command": "dict unset d",
     "message": "wrong # args: should be \"dict unset dictVarName key ?key ...?\""
    },
    {
     "command": "dict keys {a 1 b}",
     "message": "missing value to go with key"
    },
    {
     "command": "dict values x",
     "message": "missing value to go with key"
    },
    {
     "command": "dict size {a}",
     "message": "missing value to go with key"
    },
    {
     "command": "dict size",
     "message": "wrong # args: should be \"dict size dictionary\""
    },
    {
     "command": "dict for {k} {a 1} {}",
     "message": "must have exactly two variable names"
    },
    {
     "command": "dict for {k v} {a 1} {error boom}",
     "message": "boom"
    },
    {
     "command": "dict map {k} {a 1} {}",
     "message": "must have exactly two variable names"
    },
    {
     "command": "dict map {k v} {a 1} {error inner}",
     "message": "inner"
    },
    {
     "command": "dict filter {a 1} bogus x",
     "message": "bad filterType \"bogus\": must be key, script, or value"
    },
    {
     "command": "dict filter {a 1} script {k v} {expr {\"x\"}}",
     "message": "expected boolean value but got \"x\""
    },
    {
     "command": "dict merge {a 1} {b}",
     "message": "missing value to go with key"
    },
    {
     "command": "dict remove {a}",
     "message": "missing value to go with key"
    },
    {
     "command": "dict replace {a 1} b",
     "message": "wrong # args: should be \"dict replace dictionary ?key value ...?\""
    },
    {
     "command": "dict append d",
     "message": "wrong # args: should be \"dict append dictVarName key ?value ...?\""
    },
    {
     "command": "dict update d a v b {}",
     "message": "wrong # args: should be \"dict update dictVarName key varName ?key varName ...? script\""
    },
    {
     "command": "dict info {a}",
     "message": "missing value to go with key"
    }
   ],
   "differences": [
    "Many errors have `-errorcode NONE` in ztcl, where Tcl 8.6.16 and 9.0.4 give a code such as `TCL LOOKUP DICT` or `TCL VALUE DICTIONARY` ([issue 658](https://github.com/beetlebugorg/ztcl/issues/658))."
   ],
   "page": "https://beetlebug.org/ztcl/reference/dict/"
  },
  {
   "name": "array",
   "area": "dicts",
   "synopsis": [
    "array subcommand ?arg ...?"
   ],
   "summary": "The commands for arrays. An array is a variable with elements, each with a name: `name(element)`. An array is a variable and has no value of its own: pass its name, and use `array get` for a value.",
   "names": [
    "array"
   ],
   "subcommands": [
    {
     "synopsis": "array set NAME LIST",
     "summary": "Sets the elements from a list of names and values."
    },
    {
     "synopsis": "array get NAME ?PATTERN?",
     "summary": "A list of names and values."
    },
    {
     "synopsis": "array names NAME ?MODE? ?PATTERN?",
     "summary": "The element names. MODE is `-glob`, `-exact`, or `-regexp`."
    },
    {
     "synopsis": "array exists NAME",
     "summary": "1 when the variable is an array."
    },
    {
     "synopsis": "array for {KEYVAR VALUEVAR} NAME BODY",
     "summary": "Runs BODY once for each element of a copy of the array. Tcl 9.1 only."
    },
    {
     "synopsis": "array default get|set|exists|unset NAME ?VALUE?",
     "summary": "The value that a read of a missing element gives. `info exists` and `array get` do not see it. Tcl 9.1 only."
    },
    {
     "synopsis": "array size NAME",
     "summary": "The count of elements."
    },
    {
     "synopsis": "array unset NAME ?PATTERN?",
     "summary": "Removes the elements, or the whole array."
    },
    {
     "synopsis": "array statistics NAME",
     "summary": "Text about the hash table."
    },
    {
     "synopsis": "array startsearch NAME",
     "summary": "A search id, for the old way to go through an array one element at a time."
    },
    {
     "synopsis": "array nextelement NAME ID",
     "summary": "The next element name of the search."
    },
    {
     "synopsis": "array anymore NAME ID",
     "summary": "1 when the search has more elements."
    },
    {
     "synopsis": "array donesearch NAME ID",
     "summary": "Ends the search."
    }
   ],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "array set a {x 1 y 2}; array size a",
     "result": "2"
    },
    {
     "command": "set a(x)",
     "result": "1"
    },
    {
     "command": "lsort [array names a]",
     "result": "x y"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/array/"
  },
  {
   "name": "expr",
   "area": "math",
   "synopsis": [
    "expr ARG ?ARG ...?"
   ],
   "summary": "Computes an expression with the operators of C and the math functions.",
   "names": [
    "expr"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "expr {2 ** 100}",
     "result": "1267650600228229401496703205376"
    },
    {
     "command": "expr {7 / 2}",
     "result": "3"
    },
    {
     "command": "expr {-7 / 2}",
     "result": "-4"
    },
    {
     "command": "expr {7 % -2}",
     "result": "-1"
    },
    {
     "command": "expr {7 / 2.0}",
     "result": "3.5"
    },
    {
     "command": "expr {\"a\" eq \"a\" ? \"same\" : \"other\"}",
     "result": "same"
    },
    {
     "command": "expr {5 in {1 5 9}}",
     "result": "1"
    },
    {
     "command": "expr {\"1\" == \"1.0\"}",
     "result": "1"
    },
    {
     "command": "expr {\"1\" eq \"1.0\"}",
     "result": "0"
    },
    {
     "command": "expr {2 ** 3 ** 2}",
     "result": "512"
    },
    {
     "command": "expr {0x10 + 0b101}",
     "result": "21"
    },
    {
     "command": "expr {1.0 / 0}",
     "result": "Inf"
    },
    {
     "command": "expr {0 && [error never]}",
     "result": "0"
    },
    {
     "command": "expr {abs(-3) + max(1, 5)}",
     "result": "8"
    },
    {
     "command": "expr {1 + 2} {* 3}",
     "result": "7"
    }
   ],
   "errors": [
    {
     "command": "expr {1 / 0}",
     "message": "divide by zero"
    },
    {
     "command": "expr {\"ten\" + 1}",
     "message": "can't use non-numeric string as operand of \"+\""
    },
    {
     "command": "expr {7.0 % 2}",
     "message": "can't use floating-point value as operand of \"%\""
    },
    {
     "command": "expr {0 ** -1}",
     "message": "exponentiation of zero by negative power"
    },
    {
     "command": "expr {(1 + 2}",
     "message": "unbalanced open paren\nin expression \"(1 + 2\""
    },
    {
     "command": "expr {nosuchfunc(1)}",
     "message": "invalid command name \"tcl::mathfunc::nosuchfunc\""
    },
    {
     "command": "expr",
     "message": "wrong # args: should be \"expr arg ?arg ...?\""
    }
   ],
   "differences": [
    "An operation with no numeric result, such as `0.0 / 0`, gives `NaN`, where Tcl 8.6.16 and 9.0.4 raise a domain error ([issue 679](https://github.com/beetlebugorg/ztcl/issues/679)).",
    "In Tcl 9.0.4 the message of an operand of the wrong type names the operand and its side, such as `cannot use non-numeric string \"ten\" as left operand of \"+\"`. ztcl gives the message of Tcl 8.6 in both releases ([issue 680](https://github.com/beetlebugorg/ztcl/issues/680)).",
    "A variable with no value has `-errorcode NONE`, where Tcl 8.6.16 and 9.0.4 give `TCL LOOKUP VARNAME` ([issue 658](https://github.com/beetlebugorg/ztcl/issues/658))."
   ],
   "page": "https://beetlebug.org/ztcl/reference/expr/"
  },
  {
   "name": "incr",
   "area": "math",
   "synopsis": [
    "incr varName ?increment?"
   ],
   "summary": "Adds increment (1 by default) to the integer in a variable, and gives the new value. It makes the variable with 0 first when it has no value.",
   "names": [
    "incr"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "set n 5; incr n -2",
     "result": "3"
    }
   ],
   "errors": [
    {
     "command": "set s abc; incr s",
     "message": "expected integer but got \"abc\""
    }
   ],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/incr/"
  },
  {
   "name": "tcl::mathfunc",
   "area": "math",
   "synopsis": [
    "tcl::mathfunc::NAME ?arg ...?"
   ],
   "summary": "The functions of `expr`, each one also a command in this namespace. `abs`, `ceil`, `floor`, `round`, `int`, `wide`, `entier`, `double`, `bool`, `sqrt`, `isqrt`, `exp`, `log`, `log10`, `pow`, `fmod`, `hypot`, `max`, `min`, `sin`, `cos`, `tan`, `asin`, `acos`, `atan`, `atan2`, `sinh`, `cosh`, `tanh`, `rand`, and `srand`. A proc in this namespace adds a function to `expr`.",
   "names": [
    "tcl::mathfunc",
    "tcl::mathfunc::abs",
    "tcl::mathfunc::acos",
    "tcl::mathfunc::asin",
    "tcl::mathfunc::atan",
    "tcl::mathfunc::atan2",
    "tcl::mathfunc::bool",
    "tcl::mathfunc::ceil",
    "tcl::mathfunc::cos",
    "tcl::mathfunc::cosh",
    "tcl::mathfunc::double",
    "tcl::mathfunc::entier",
    "tcl::mathfunc::exp",
    "tcl::mathfunc::floor",
    "tcl::mathfunc::fmod",
    "tcl::mathfunc::hypot",
    "tcl::mathfunc::int",
    "tcl::mathfunc::isqrt",
    "tcl::mathfunc::log",
    "tcl::mathfunc::log10",
    "tcl::mathfunc::max",
    "tcl::mathfunc::min",
    "tcl::mathfunc::pow",
    "tcl::mathfunc::rand",
    "tcl::mathfunc::round",
    "tcl::mathfunc::sin",
    "tcl::mathfunc::sinh",
    "tcl::mathfunc::sqrt",
    "tcl::mathfunc::srand",
    "tcl::mathfunc::tan",
    "tcl::mathfunc::tanh",
    "tcl::mathfunc::wide"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "expr {max(3, 9, 4)}",
     "result": "9"
    },
    {
     "command": "expr {round(2.5)}",
     "result": "3"
    },
    {
     "command": "expr {isqrt(17)}",
     "result": "4"
    },
    {
     "command": "proc tcl::mathfunc::twice {x} {expr {$x * 2}}; expr {twice(21)}",
     "result": "42"
    }
   ],
   "errors": [],
   "differences": [
    "`rand()` has a fixed seed in a new interpreter, so that a script with no capability gives the same output each run."
   ],
   "page": "https://beetlebug.org/ztcl/reference/tcl-mathfunc/"
  },
  {
   "name": "tcl::mathfunc::trunc",
   "area": "math",
   "synopsis": [
    "tcl::mathfunc::NAME arg ?arg ...?"
   ],
   "summary": "The math functions of Tcl 9.1: the functions of C99 `acosh`, `asinh`, `atanh`, `cbrt`, `copysign`, `dim` (fdim of C), `erf`, `erfc`, `exp2`, `expm1`, `fma`, `gamma` (tgamma of C), `ldexp`, `lgamma`, `log1p`, `log2`, `logb`, `nextafter`, `remainder`, and `trunc`, and the tests `isfinite`, `isinf`, `isnan`, `isnormal`, `issubnormal`, `isunordered`, and `signbit`. Each function except a test gives a double. A test gives 0 or 1, and it takes NaN, an integer of any size, or a double.",
   "names": [
    "tcl::mathfunc::trunc",
    "tcl::mathfunc::acosh",
    "tcl::mathfunc::asinh",
    "tcl::mathfunc::atanh",
    "tcl::mathfunc::cbrt",
    "tcl::mathfunc::copysign",
    "tcl::mathfunc::dim",
    "tcl::mathfunc::erf",
    "tcl::mathfunc::erfc",
    "tcl::mathfunc::exp2",
    "tcl::mathfunc::expm1",
    "tcl::mathfunc::fma",
    "tcl::mathfunc::gamma",
    "tcl::mathfunc::isfinite",
    "tcl::mathfunc::isinf",
    "tcl::mathfunc::isnan",
    "tcl::mathfunc::isnormal",
    "tcl::mathfunc::issubnormal",
    "tcl::mathfunc::isunordered",
    "tcl::mathfunc::ldexp",
    "tcl::mathfunc::lgamma",
    "tcl::mathfunc::log1p",
    "tcl::mathfunc::log2",
    "tcl::mathfunc::logb",
    "tcl::mathfunc::nextafter",
    "tcl::mathfunc::remainder",
    "tcl::mathfunc::signbit"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": "9.1",
   "compute": "1 for the call",
   "examples": [
    {
     "command": "expr {trunc(-2.5)}",
     "result": "-2.0"
    },
    {
     "command": "expr {log2(8)}",
     "result": "3.0"
    },
    {
     "command": "expr {remainder(7, 2)}",
     "result": "-1.0"
    },
    {
     "command": "expr {isnan(NaN)}",
     "result": "1"
    },
    {
     "command": "expr {signbit(-0.0)}",
     "result": "1"
    }
   ],
   "errors": [
    {
     "command": "expr {log2(-1)}",
     "message": "domain error: argument not in valid range"
    },
    {
     "command": "expr {trunc(\"a\")}",
     "message": "expected floating-point number but got \"a\""
    }
   ],
   "differences": [
    "The functions come from `std.math` of Zig. The last digit of a result can differ from tclsh 9.1.0, which gives 3.0000000000000004 for `cbrt(27)`. tclsh gives the error \"floating-point value too large to represent\" for some results below 2**-1022, such as `asinh(1e-310)`, and ztcl gives the result."
   ],
   "page": "https://beetlebug.org/ztcl/reference/tcl-mathfunc-trunc/"
  },
  {
   "name": "tcl::mathop::lt",
   "area": "math",
   "synopsis": [
    "tcl::mathop::lt ?arg ...?"
   ],
   "summary": "The string order operators of Tcl 9.1: `lt`, `gt`, `le`, and `ge`. In `expr` they compare two values as strings, with the precedence of `<`. As a command, each one gives 1 when each pair of neighbor arguments is in the order.",
   "names": [
    "tcl::mathop::lt",
    "tcl::mathop::gt",
    "tcl::mathop::le",
    "tcl::mathop::ge"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": "9.1",
   "compute": "1 for the call",
   "examples": [
    {
     "command": "expr {\"10\" lt \"9\"}",
     "result": "1"
    },
    {
     "command": "expr {\"b\" ge \"a\"}",
     "result": "1"
    },
    {
     "command": "tcl::mathop::lt a b c",
     "result": "1"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/tcl-mathop-lt/"
  },
  {
   "name": "divmod",
   "area": "math",
   "synopsis": [
    "divmod dividend divisor"
   ],
   "summary": "The quotient and the remainder of two integers of any size, as a list. The quotient is rounded down, as `/` of `expr` does, so the remainder has the sign of the divisor.",
   "names": [
    "divmod"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": "9.1",
   "compute": "1 for the call",
   "examples": [
    {
     "command": "divmod 7 2",
     "result": "3 1"
    },
    {
     "command": "divmod -7 2",
     "result": "-4 1"
    }
   ],
   "errors": [
    {
     "command": "divmod 7 0",
     "message": "divide by zero"
    },
    {
     "command": "divmod 7.5 2",
     "message": "dividend must be an integer"
    }
   ],
   "differences": [
    "tclsh 9.1.0 gives a wrong quotient for `divmod 9223372036854775807 -1` and ends with SIGFPE for `divmod -9223372036854775808 -1`. ztcl gives the exact result."
   ],
   "page": "https://beetlebug.org/ztcl/reference/divmod/"
  },
  {
   "name": "fpclassify",
   "area": "math",
   "synopsis": [
    "fpclassify floatValue"
   ],
   "summary": "The class of a number: `zero`, `subnormal`, `normal`, `infinite`, or `nan`.",
   "names": [
    "fpclassify"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": "9.1",
   "compute": "1 for the call",
   "examples": [
    {
     "command": "fpclassify 1.5",
     "result": "normal"
    },
    {
     "command": "fpclassify 1e-310",
     "result": "subnormal"
    },
    {
     "command": "fpclassify Inf",
     "result": "infinite"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/fpclassify/"
  },
  {
   "name": "frexp",
   "area": "math",
   "synopsis": [
    "frexp floatValue"
   ],
   "summary": "The fraction and the exponent of a double, as a list. The fraction is from 0.5 to 1, and the value is the fraction times 2 to the exponent.",
   "names": [
    "frexp"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": "9.1",
   "compute": "1 for the call",
   "examples": [
    {
     "command": "frexp 10",
     "result": "0.625 4"
    },
    {
     "command": "frexp -3",
     "result": "-0.75 2"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/frexp/"
  },
  {
   "name": "modf",
   "area": "math",
   "synopsis": [
    "modf floatValue"
   ],
   "summary": "The integer part and the fraction part of a double, as a list. Both parts have the sign of the value.",
   "names": [
    "modf"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": "9.1",
   "compute": "1 for the call",
   "examples": [
    {
     "command": "modf 2.5",
     "result": "2.0 0.5"
    },
    {
     "command": "modf -2.5",
     "result": "-2.0 -0.5"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/modf/"
  },
  {
   "name": "remquo",
   "area": "math",
   "synopsis": [
    "remquo dividend divisor"
   ],
   "summary": "The remainder of `remainder()` and the low 3 bits of the rounded quotient with the sign of the quotient, as a list.",
   "names": [
    "remquo"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": "9.1",
   "compute": "1 for the call",
   "examples": [
    {
     "command": "remquo 7 2",
     "result": "-1.0 4"
    },
    {
     "command": "remquo 100 3",
     "result": "1.0 1"
    }
   ],
   "errors": [
    {
     "command": "remquo 7 0",
     "message": "domain error: argument not in valid range"
    }
   ],
   "differences": [
    "tclsh 9.1.0 gives NaN and an undefined quotient for a zero divisor or an infinite dividend. ztcl gives a domain error, as `remainder()` does."
   ],
   "page": "https://beetlebug.org/ztcl/reference/remquo/"
  },
  {
   "name": "tcl::mathop",
   "area": "math",
   "synopsis": [
    "tcl::mathop::OP ?arg ...?"
   ],
   "summary": "Each operator of `expr` as a command: `+`, `-`, `*`, `/`, `%`, `**`, `<<`, `>>`, `&`, `|`, `^`, `~`, `!`, `==`, `!=`, `<`, `<=`, `>`, `>=`, `eq`, `ne`, `in`, and `ni`. `+` and `*` take any count of arguments. Import them with `namespace path tcl::mathop` to write `+ 1 2`.",
   "names": [
    "tcl::mathop",
    "tcl::mathop::!",
    "tcl::mathop::!=",
    "tcl::mathop::%",
    "tcl::mathop::&",
    "tcl::mathop::*",
    "tcl::mathop::**",
    "tcl::mathop::+",
    "tcl::mathop::-",
    "tcl::mathop::/",
    "tcl::mathop::<",
    "tcl::mathop::<<",
    "tcl::mathop::<=",
    "tcl::mathop::==",
    "tcl::mathop::>",
    "tcl::mathop::>=",
    "tcl::mathop::>>",
    "tcl::mathop::^",
    "tcl::mathop::eq",
    "tcl::mathop::in",
    "tcl::mathop::ne",
    "tcl::mathop::ni",
    "tcl::mathop::|",
    "tcl::mathop::~"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "tcl::mathop::+ 1 2 3",
     "result": "6"
    },
    {
     "command": "tcl::mathop::< 1 2 3",
     "result": "1"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/tcl-mathop/"
  },
  {
   "name": "noise3",
   "area": "math",
   "synopsis": [
    "noise3 x y z"
   ],
   "summary": "Smooth noise of three coordinates, a float from -1 to 1, for shapes and textures. The same coordinates give the same value. The noise seed of the interpreter sets the pattern.",
   "names": [
    "noise3"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "a few compute units.",
   "examples": [
    {
     "command": "expr {[noise3 0 0 0] == [noise3 0 0 0]}",
     "result": "1"
    }
   ],
   "errors": [],
   "differences": [
    "Tcl has no `noise3`."
   ],
   "page": "https://beetlebug.org/ztcl/reference/noise3/"
  },
  {
   "name": "set",
   "area": "variables",
   "synopsis": [
    "set varName ?newValue?"
   ],
   "summary": "With a value, sets the variable and gives the value. Without one, gives the value of the variable. `name(el)` is an element of an array.",
   "names": [
    "set"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "set note \"buy milk\"",
     "result": "buy milk"
    },
    {
     "command": "set note",
     "result": "buy milk"
    }
   ],
   "errors": [
    {
     "command": "set nope",
     "message": "can't read \"nope\": no such variable"
    }
   ],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/set/"
  },
  {
   "name": "unset",
   "area": "variables",
   "synopsis": [
    "unset ?-nocomplain? ?--? ?name ...?"
   ],
   "summary": "Removes variables. A missing variable is an error, unless `-nocomplain`.",
   "names": [
    "unset"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "set x 1; unset x; info exists x",
     "result": "0"
    }
   ],
   "errors": [
    {
     "command": "unset nope",
     "message": "can't unset \"nope\": no such variable"
    }
   ],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/unset/"
  },
  {
   "name": "global",
   "area": "variables",
   "synopsis": [
    "global ?varName ...?"
   ],
   "summary": "In a proc, links each name to the variable of the same name at the top level. Outside a proc it has no effect.",
   "names": [
    "global"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "set total 5; proc show {} {global total; return $total}; show",
     "result": "5"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/global/"
  },
  {
   "name": "variable",
   "area": "variables",
   "synopsis": [
    "variable ?name value ...? name ?value?"
   ],
   "summary": "In a namespace, makes namespace variables and gives them values. In a proc, links each name to the variable of the namespace of the proc.",
   "names": [
    "variable"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "namespace eval cfg {variable size 10}; set cfg::size",
     "result": "10"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/variable/"
  },
  {
   "name": "upvar",
   "area": "variables",
   "synopsis": [
    "upvar ?level? otherVar localVar ?otherVar localVar ...?"
   ],
   "summary": "Links a local name to a variable of a caller. The level is `1` for the caller (the default), `2` for its caller, or `#0` for the top level. This is the way to pass a variable by name.",
   "names": [
    "upvar"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "proc bump {name} {upvar 1 $name v; incr v}; set c 1; bump c",
     "result": "2"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/upvar/"
  },
  {
   "name": "trace",
   "area": "variables",
   "synopsis": [
    "trace option ?arg ...?"
   ],
   "summary": "Runs a command when a variable is read, written, or unset, or when a command is renamed, deleted, or run.",
   "names": [
    "trace"
   ],
   "subcommands": [
    {
     "synopsis": "trace add variable NAME OPS CMD",
     "summary": "OPS is a list of `read`, `write`, `unset`, and `array`. CMD gets the name, the element, and the op."
    },
    {
     "synopsis": "trace add command NAME OPS CMD",
     "summary": "OPS is a list of `rename` and `delete`."
    },
    {
     "synopsis": "trace add execution NAME OPS CMD",
     "summary": "OPS is a list of `enter`, `leave`, `enterstep`, and `leavestep`."
    },
    {
     "synopsis": "trace remove TYPE NAME OPS CMD",
     "summary": "Removes a trace."
    },
    {
     "synopsis": "trace info TYPE NAME",
     "summary": "The traces of a name."
    },
    {
     "synopsis": "trace variable NAME OPS CMD",
     "summary": "The old form of `trace add variable`."
    },
    {
     "synopsis": "trace vdelete NAME OPS CMD",
     "summary": "The old form of `trace remove variable`."
    },
    {
     "synopsis": "trace vinfo NAME",
     "summary": "The old form of `trace info variable`."
    }
   ],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "set log {}; set v 0; trace add variable v write {apply {{n e op} {lappend ::log $op}}}; set v 1; set log",
     "result": "write"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/trace/"
  },
  {
   "name": "if",
   "area": "control",
   "synopsis": [
    "if expr1 ?then? body1 elseif expr2 ?then? body2 ... ?else? ?bodyN?"
   ],
   "summary": "Runs the body of the first condition that is true. Each condition is an `expr` expression in braces. The result is the result of the body that ran, or an empty string.",
   "names": [
    "if"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "set n 7; if {$n > 5} {set r big} else {set r small}",
     "result": "big"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/if/"
  },
  {
   "name": "while",
   "area": "control",
   "synopsis": [
    "while test command"
   ],
   "summary": "Runs the command while the test, an `expr` expression, is true. Put the test in braces, so that it is read again on each pass. The result is an empty string.",
   "names": [
    "while"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "set i 0; while {$i < 3} {incr i}; set i",
     "result": "3"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/while/"
  },
  {
   "name": "for",
   "area": "control",
   "synopsis": [
    "for start test next command"
   ],
   "summary": "Runs start once, then the command and next while the test is true, as the `for` of C.",
   "names": [
    "for"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "set s 0; for {set i 1} {$i <= 4} {incr i} {incr s $i}; set s",
     "result": "10"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/for/"
  },
  {
   "name": "break",
   "area": "control",
   "synopsis": [
    "break"
   ],
   "summary": "Stops the loop that runs it: `while`, `for`, `foreach`, `lmap`, or `dict for`.",
   "names": [
    "break"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "foreach x {1 2 3} {if {$x == 2} break; set last $x}; set last",
     "result": "1"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/break/"
  },
  {
   "name": "continue",
   "area": "control",
   "synopsis": [
    "continue"
   ],
   "summary": "Goes on with the next pass of the loop that runs it.",
   "names": [
    "continue"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "set s {}; foreach x {1 2 3} {if {$x == 2} continue; append s $x}; set s",
     "result": "13"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/continue/"
  },
  {
   "name": "switch",
   "area": "control",
   "synopsis": [
    "switch ?-option ...? string ?pattern body ...? ?default body?"
   ],
   "summary": "Runs the body of the first pattern that matches the string. A body of `-` uses the body of the next pattern. The patterns and bodies can be one list in braces.",
   "names": [
    "switch"
   ],
   "subcommands": [],
   "options": [
    {
     "option": "-exact",
     "summary": "The pattern equals the string (the default)."
    },
    {
     "option": "-glob",
     "summary": "A glob pattern."
    },
    {
     "option": "-regexp",
     "summary": "A regular expression."
    },
    {
     "option": "-integer",
     "summary": "Tcl 9.1 only: the pattern and the string are the same integer, such as 16 and 0x10. A value that is not an integer is an error."
    },
    {
     "option": "-nocase",
     "summary": "Matches letters with no case."
    },
    {
     "option": "--",
     "summary": "The end of the options, for a string that starts with `-`."
    }
   ],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "switch -glob -- milk {m* {set r m} default {set r other}}",
     "result": "m"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/switch/"
  },
  {
   "name": "case",
   "area": "control",
   "synopsis": [
    "case string ?in? ?pattern body ...? ?default body?"
   ],
   "summary": "The old form of `switch -glob`. Use `switch` in new code.",
   "names": [
    "case"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "case abc in {a* {set r yes}}",
     "result": "yes"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/case/"
  },
  {
   "name": "eval",
   "area": "control",
   "synopsis": [
    "eval arg ?arg ...?"
   ],
   "summary": "Joins its arguments as `concat` does and runs the result as a script. The text of each value runs as code: use it only on scripts that you built with `list`.",
   "names": [
    "eval"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "eval [list set x \"a b\"]",
     "result": "a b"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/eval/"
  },
  {
   "name": "uplevel",
   "area": "control",
   "synopsis": [
    "uplevel ?level? command ?arg ...?"
   ],
   "summary": "Runs a script in the scope of a caller: `1` (the default) is the caller, and `#0` is the top level. Code that makes control commands uses it.",
   "names": [
    "uplevel"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "proc setInCaller {} {uplevel 1 {set made yes}}; setInCaller; set made",
     "result": "yes"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/uplevel/"
  },
  {
   "name": "apply",
   "area": "control",
   "synopsis": [
    "apply lambdaExpr ?arg ...?"
   ],
   "summary": "Runs a lambda: a list of the arguments and a body, with an optional namespace. It works as a proc with no name.",
   "names": [
    "apply"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "apply {{x y} {expr {$x + $y}}} 2 3",
     "result": "5"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/apply/"
  },
  {
   "name": "time",
   "area": "control",
   "synopsis": [
    "time command ?count?"
   ],
   "summary": "Runs the command count times (1 by default) and gives the mean time of one run in microseconds.",
   "names": [
    "time"
   ],
   "subcommands": [],
   "options": [],
   "capability": "clock",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/time/"
  },
  {
   "name": "timerate",
   "area": "control",
   "synopsis": [
    "timerate ?-direct? ?-calibrate? ?-overhead double? command ?time ?max-count??"
   ],
   "summary": "Runs the command for a time (1,000 ms by default) and gives the time of one run, the count of runs, and the rate.",
   "names": [
    "timerate"
   ],
   "subcommands": [],
   "options": [],
   "capability": "clock",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/timerate/"
  },
  {
   "name": "proc",
   "area": "procs",
   "synopsis": [
    "proc name args body"
   ],
   "summary": "Makes a command from a body of Tcl. args is a list of the argument names. An argument `{name default}` has a default value, and the last argument `args` gets each extra word as a list. A proc of the same name replaces the earlier one.",
   "names": [
    "proc"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "proc greet {who {word Hello}} {return \"$word, $who\"}; greet Ada",
     "result": "Hello, Ada"
    },
    {
     "command": "proc sum {args} {tcl::mathop::+ {*}$args}; sum 1 2 3",
     "result": "6"
    }
   ],
   "errors": [
    {
     "command": "greet",
     "message": "wrong # args: should be \"greet who ?word?\""
    }
   ],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/proc/"
  },
  {
   "name": "return",
   "area": "procs",
   "synopsis": [
    "return ?-code code? ?-errorcode list? ?-level n? ?-options dict? ?value?"
   ],
   "summary": "Ends the proc and gives the value as its result. `-code error` gives an error to the caller with the value as its message. `-code break` and `-code continue` stop a loop of the caller.",
   "names": [
    "return"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "proc check {n} {if {$n < 0} {return -code error -errorcode {NEG} \"negative\"}; return ok}; check 1",
     "result": "ok"
    }
   ],
   "errors": [
    {
     "command": "check -1",
     "message": "negative"
    }
   ],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/return/"
  },
  {
   "name": "tailcall",
   "area": "procs",
   "synopsis": [
    "tailcall command ?arg ...?"
   ],
   "summary": "Ends the proc and runs the command in its place, so that the stack does not grow. The result of the command is the result of the proc.",
   "names": [
    "tailcall"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "proc down {n} {if {$n == 0} {return done}; tailcall down [incr n -1]}; down 100000",
     "result": "done"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/tailcall/"
  },
  {
   "name": "rename",
   "area": "procs",
   "synopsis": [
    "rename oldName newName"
   ],
   "summary": "Gives a command a new name. An empty newName removes the command.",
   "names": [
    "rename"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "proc a {} {return 1}; rename a b; b",
     "result": "1"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/rename/"
  },
  {
   "name": "namespace",
   "area": "procs",
   "synopsis": [
    "namespace subcommand ?arg ...?"
   ],
   "summary": "The commands for namespaces: groups of commands and variables with a name. `::` is the top namespace, and `a::b` is a namespace in `a`.",
   "names": [
    "namespace"
   ],
   "subcommands": [
    {
     "synopsis": "namespace eval NS SCRIPT",
     "summary": "Runs SCRIPT in NS, and makes NS when it does not exist."
    },
    {
     "synopsis": "namespace current",
     "summary": "The name of the current namespace."
    },
    {
     "synopsis": "namespace children ?NS? ?PATTERN?",
     "summary": "The namespaces in NS."
    },
    {
     "synopsis": "namespace parent ?NS?",
     "summary": "The namespace around NS."
    },
    {
     "synopsis": "namespace exists NS",
     "summary": "1 when NS exists."
    },
    {
     "synopsis": "namespace delete ?NS ...?",
     "summary": "Removes namespaces with their commands and variables."
    },
    {
     "synopsis": "namespace export ?-clear? ?PATTERN ...?",
     "summary": "The commands that other code can import, and that an ensemble has."
    },
    {
     "synopsis": "namespace import ?-force? ?PATTERN ...?",
     "summary": "Makes the exported commands of another namespace callable by their short names."
    },
    {
     "synopsis": "namespace forget ?PATTERN ...?",
     "summary": "Removes imported commands."
    },
    {
     "synopsis": "namespace ensemble create ?-option value ...?",
     "summary": "Makes the namespace a command with its exported commands as subcommands. `configure` and `exists` go with it."
    },
    {
     "synopsis": "namespace path ?LIST?",
     "summary": "The namespaces where a command name is looked up after the current one."
    },
    {
     "synopsis": "namespace which ?-command? ?-variable? NAME",
     "summary": "The full name of a command or variable, or an empty string."
    },
    {
     "synopsis": "namespace origin CMD",
     "summary": "The full name of the command that an imported command points to."
    },
    {
     "synopsis": "namespace qualifiers NAME",
     "summary": "The part of NAME before its last `::`."
    },
    {
     "synopsis": "namespace tail NAME",
     "summary": "The part of NAME after its last `::`."
    },
    {
     "synopsis": "namespace code SCRIPT",
     "summary": "A script that runs in the current namespace from each place, for a callback."
    },
    {
     "synopsis": "namespace inscope NS SCRIPT ?ARG ...?",
     "summary": "Runs SCRIPT in NS. `namespace code` makes this form."
    },
    {
     "synopsis": "namespace upvar NS OTHERVAR MYVAR ?OTHERVAR MYVAR ...?",
     "summary": "Links local names to variables of NS."
    },
    {
     "synopsis": "namespace unknown ?SCRIPT?",
     "summary": "The handler of an unknown command in the namespace."
    }
   ],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "namespace eval jot {proc add {} {return added}; namespace export add; namespace ensemble create}; jot add",
     "result": "added"
    },
    {
     "command": "namespace tail ::a::b::c",
     "result": "c"
    },
    {
     "command": "namespace qualifiers ::a::b::c",
     "result": "::a::b"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/namespace/"
  },
  {
   "name": "unknown",
   "area": "procs",
   "synopsis": [
    "unknown commandName ?arg ...?"
   ],
   "summary": "The command that runs for a command name that does not exist. The default gives the error `invalid command name`. A new `unknown` can load or make the command.",
   "names": [
    "unknown"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [
    {
     "command": "nosuchcommand",
     "message": "invalid command name \"nosuchcommand\""
    }
   ],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/unknown/"
  },
  {
   "name": "coroutine",
   "area": "procs",
   "synopsis": [
    "coroutine name cmd ?arg ...?"
   ],
   "summary": "Makes a command name and runs cmd until its first `yield`. The value of that `yield` is the result of `coroutine`. Each call of name goes on to the next `yield`, and its argument is the result of that `yield`. The coroutine ends when cmd returns.",
   "names": [
    "coroutine"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "coroutine gen apply {{} {yield 1; yield 2; return 3}}",
     "result": "1"
    },
    {
     "command": "gen",
     "result": "2"
    }
   ],
   "errors": [],
   "differences": [
    "The WebAssembly builds have no `coroutine` in this version: the error is \"coroutine is not available on this target\"."
   ],
   "page": "https://beetlebug.org/ztcl/reference/coroutine/"
  },
  {
   "name": "yield",
   "area": "procs",
   "synopsis": [
    "yield ?value?"
   ],
   "summary": "Stops the coroutine that runs it and gives the value to the caller. The next call of the coroutine goes on after the `yield`.",
   "names": [
    "yield"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "coroutine c apply {{} {set got [yield first]; return \"got $got\"}}; c hello",
     "result": "got hello"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/yield/"
  },
  {
   "name": "yieldto",
   "area": "procs",
   "synopsis": [
    "yieldto command ?arg ...?"
   ],
   "summary": "Stops the coroutine and runs the command in the place of the caller. The arguments of the next call of the coroutine are the result of `yieldto`, as a list.",
   "names": [
    "yieldto"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/yieldto/"
  },
  {
   "name": "coroinject",
   "area": "procs",
   "synopsis": [
    "coroinject coroName cmd ?arg ...?"
   ],
   "summary": "Puts a command in a suspended coroutine. At the next resume the command runs in the coroutine, with two more arguments: the name of the command that suspended it (`yield` or `yieldto`) and the value of the resume. Its result is the result of that `yield` or `yieldto`. A command put in later runs first, and its result is the value of the next one.",
   "names": [
    "coroinject"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": "9.1",
   "compute": "1 for the call",
   "examples": [
    {
     "command": "coroutine c apply {{} {return [yield]}}; coroinject c apply {{op v} {string toupper $v}}; c hi",
     "result": "HI"
    }
   ],
   "errors": [
    {
     "command": "coroinject nope set x",
     "message": "can only inject a command into a coroutine"
    }
   ],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/coroinject/"
  },
  {
   "name": "coroprobe",
   "area": "procs",
   "synopsis": [
    "coroprobe coroName cmd ?arg ...?"
   ],
   "summary": "Runs a command now in a suspended coroutine, in the place where it waits, and gives its result. The coroutine stays suspended, and the next resume goes on as before.",
   "names": [
    "coroprobe"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": "9.1",
   "compute": "1 for the call",
   "examples": [
    {
     "command": "coroutine c apply {{} {set n 5; yield; return $n}}; coroprobe c set n",
     "result": "5"
    }
   ],
   "errors": [
    {
     "command": "coroprobe nope set x",
     "message": "can only inject a probe command into a coroutine"
    }
   ],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/coroprobe/"
  },
  {
   "name": "tcl::unsupported::inject",
   "area": "procs",
   "synopsis": [
    "tcl::unsupported::inject coroName cmd ?arg ...?"
   ],
   "summary": "Puts a command in a suspended coroutine. At the next resume the command runs in the coroutine with its own words only, and the coroutine goes on. The form of Tcl 8.6 of `coroinject`.",
   "names": [
    "tcl::unsupported::inject"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "coroutine c apply {{} {yield; return $::x}}; set x 1; tcl::unsupported::inject c set ::x 2; c",
     "result": "2"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/tcl-unsupported-inject/"
  },
  {
   "name": "tcl::unsupported::corotype",
   "area": "procs",
   "synopsis": [
    "tcl::unsupported::corotype coroName"
   ],
   "summary": "How a coroutine waits: `yield` or `yieldto`, or `active` while it runs.",
   "names": [
    "tcl::unsupported::corotype"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "coroutine c apply {{} {yield}}; tcl::unsupported::corotype c",
     "result": "yield"
    }
   ],
   "errors": [
    {
     "command": "tcl::unsupported::corotype nope",
     "message": "can only get coroutine type of a coroutine"
    }
   ],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/tcl-unsupported-corotype/"
  },
  {
   "name": "walk",
   "area": "procs",
   "synopsis": [
    "walk"
   ],
   "summary": "A command of the runner of ztcl for its own tests.",
   "names": [
    "walk"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [
    "Tcl has no `walk`."
   ],
   "page": "https://beetlebug.org/ztcl/reference/walk/"
  },
  {
   "name": "error",
   "area": "errors",
   "synopsis": [
    "error message ?errorInfo? ?errorCode?"
   ],
   "summary": "Gives an error with the message. The error goes up through each caller until a `catch` or a `try` stops it. errorCode is a list that code can match, such as `{JOT EMPTY}`. With no errorCode it is `NONE`.",
   "names": [
    "error"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [
    {
     "command": "error \"a note needs text\"",
     "message": "a note needs text"
    }
   ],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/error/"
  },
  {
   "name": "throw",
   "area": "errors",
   "synopsis": [
    "throw type message"
   ],
   "summary": "Gives an error with the error code type and the message. `try` with `trap` matches the start of type.",
   "names": [
    "throw"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "try {throw {JOT EMPTY} \"no text\"} trap {JOT} {msg} {set msg}",
     "result": "no text"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/throw/"
  },
  {
   "name": "catch",
   "area": "errors",
   "synopsis": [
    "catch script ?resultVarName? ?optionVarName?"
   ],
   "summary": "Runs the script and gives its return code: 0 for a result, 1 for an error, 2 for `return`, 3 for `break`, and 4 for `continue`. resultVarName gets the result or the message, and optionVarName gets the options dict with `-errorcode` and `-errorinfo`. The error of the compute limit goes through `catch`.",
   "names": [
    "catch"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "catch {expr {1 / 0}} msg",
     "result": "1"
    },
    {
     "command": "catch {expr {1 / 0}} msg opts; dict get $opts -errorcode",
     "result": "ARITH DIVZERO {divide by zero}"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/catch/"
  },
  {
   "name": "try",
   "area": "errors",
   "synopsis": [
    "try body ?handler ...? ?finally script?"
   ],
   "summary": "Runs the body and then the first handler that matches its result. `on CODE VARS SCRIPT` matches a return code: `ok`, `error`, `return`, `break`, `continue`, or a number. `trap PATTERN VARS SCRIPT` matches an error whose error code starts with the list PATTERN. VARS names the variables for the result and the options. `finally` runs at the end in each case.",
   "names": [
    "try"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "try {expr {1 / 0}} trap {ARITH DIVZERO} {} {set r \"no zero\"}",
     "result": "no zero"
    },
    {
     "command": "try {set x 1} on ok {v} {set r \"got $v\"} finally {set f done}",
     "result": "got 1"
    }
   ],
   "errors": [],
   "differences": [
    "The error of the compute limit goes through each handler and through `finally`."
   ],
   "page": "https://beetlebug.org/ztcl/reference/try/"
  },
  {
   "name": "chan",
   "area": "channels",
   "synopsis": [
    "chan SUBCOMMAND ?ARG ...?"
   ],
   "summary": "The commands for channels: read, write, move, configure, and copy.",
   "names": [
    "chan"
   ],
   "subcommands": [
    {
     "synopsis": "chan puts ?-nonewline? ?CHAN? STRING",
     "summary": "Writes a string and a newline to a channel."
    },
    {
     "synopsis": "chan gets CHAN ?VAR?",
     "summary": "Reads one line from a channel."
    },
    {
     "synopsis": "chan read ?-nonewline? CHAN",
     "summary": "Reads the rest of a channel, or a count of characters."
    },
    {
     "synopsis": "chan read CHAN COUNT",
     "summary": "Reads the rest of a channel, or a count of characters."
    },
    {
     "synopsis": "chan eof CHAN",
     "summary": "Tests whether the last read reached the end of a channel."
    },
    {
     "synopsis": "chan seek CHAN OFFSET ?ORIGIN?",
     "summary": "Moves the place of the next read or write of a channel."
    },
    {
     "synopsis": "chan tell CHAN",
     "summary": "Gives the place of the next read or write of a channel."
    },
    {
     "synopsis": "chan flush CHAN",
     "summary": "Writes the buffered output of a channel."
    },
    {
     "synopsis": "chan close CHAN ?DIRECTION?",
     "summary": "Closes a channel, or one direction of it."
    },
    {
     "synopsis": "chan names ?PATTERN?",
     "summary": "Gives the names of the open channels."
    },
    {
     "synopsis": "chan configure CHAN",
     "summary": "Gives or sets the options of a channel."
    },
    {
     "synopsis": "chan configure CHAN OPTION",
     "summary": "Gives or sets the options of a channel."
    },
    {
     "synopsis": "chan configure CHAN OPTION VALUE ?OPTION VALUE ...?",
     "summary": "Gives or sets the options of a channel."
    },
    {
     "synopsis": "chan copy IN OUT ?-size SIZE? ?-command SCRIPT?",
     "summary": "Copies the data of one channel to another."
    },
    {
     "synopsis": "chan pipe",
     "summary": "Makes a pipe and gives its two channels."
    },
    {
     "synopsis": "chan pending MODE CHAN",
     "summary": "Gives the count of bytes that wait in a buffer of a channel."
    },
    {
     "synopsis": "chan blocked CHAN",
     "summary": "Tests whether the last read of a channel stopped for want of data."
    },
    {
     "synopsis": "chan event CHAN EVENT ?SCRIPT?",
     "summary": "Gives or sets the script that the event loop runs when a channel can be read or written."
    }
   ],
   "options": [],
   "capability": "channels",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "lsort [chan names std*]",
     "result": "stderr stdin stdout"
    },
    {
     "command": "lsort [chan names std*]",
     "result": "stderr stdin stdout"
    },
    {
     "command": "chan names nomatch*",
     "result": ""
    }
   ],
   "errors": [
    {
     "command": "chan bogus",
     "message": "unknown or ambiguous subcommand \"bogus\": must be close, configure, copy, eof, flush, gets, names, pipe, puts, read, seek, or tell"
    },
    {
     "command": "chan close nochan",
     "message": "can not find channel named \"nochan\""
    },
    {
     "command": "chan puts",
     "message": "wrong # args: should be \"chan puts ?-nonewline? ?channelId? string\""
    },
    {
     "command": "chan gets nochan",
     "message": "can not find channel named \"nochan\""
    },
    {
     "command": "chan eof nochan",
     "message": "can not find channel named \"nochan\""
    },
    {
     "command": "chan tell nochan",
     "message": "can not find channel named \"nochan\""
    },
    {
     "command": "chan flush nochan",
     "message": "can not find channel named \"nochan\""
    },
    {
     "command": "chan close",
     "message": "wrong # args: should be \"chan close channelId ?direction?\""
    },
    {
     "command": "chan configure nochan",
     "message": "can not find channel named \"nochan\""
    },
    {
     "command": "chan copy nochan stdout",
     "message": "can not find channel named \"nochan\""
    },
    {
     "command": "chan pipe x",
     "message": "wrong # args: should be \"chan pipe \""
    },
    {
     "command": "chan pending bogus stdin",
     "message": "bad mode \"bogus\": must be input or output"
    },
    {
     "command": "chan blocked nochan",
     "message": "can not find channel named \"nochan\""
    },
    {
     "command": "chan event stdin bogus",
     "message": "bad event name \"bogus\": must be readable or writable"
    }
   ],
   "differences": [
    "`chan` has no `create`, `push`, `pop`, `postevent`, or `truncate`, and in Tcl 9.1 no `isbinary`. The message of an unknown subcommand does not list `blocked`, `event`, and `pending` ([issue 690](https://github.com/beetlebugorg/ztcl/issues/690)).",
    "On Windows a file of tclsh writes `\\r\\n` by default, and ztcl writes `\\n` ([issue 691](https://github.com/beetlebugorg/ztcl/issues/691)).",
    "In Tcl 9.0.4 the messages of a wrong count of arguments name the channel `channel` ([issue 692](https://github.com/beetlebugorg/ztcl/issues/692))."
   ],
   "page": "https://beetlebug.org/ztcl/reference/chan/"
  },
  {
   "name": "file",
   "area": "channels",
   "synopsis": [
    "file SUBCOMMAND ?ARG ...?"
   ],
   "summary": "The commands for paths and files: names, tests, facts, and changes.",
   "names": [
    "file"
   ],
   "subcommands": [
    {
     "synopsis": "file join NAME ?NAME ...?",
     "summary": "Joins parts into one path."
    },
    {
     "synopsis": "file split NAME",
     "summary": "Gives the parts of a path as a list."
    },
    {
     "synopsis": "file dirname NAME",
     "summary": "Gives a path with no last part."
    },
    {
     "synopsis": "file tail NAME",
     "summary": "Gives the last part of a path."
    },
    {
     "synopsis": "file extension NAME",
     "summary": "Gives the extension of the last part of a path, with its dot."
    },
    {
     "synopsis": "file rootname NAME",
     "summary": "Gives a path with no extension."
    },
    {
     "synopsis": "file pathtype NAME",
     "summary": "Gives the kind of a path: absolute, relative, or volumerelative."
    },
    {
     "synopsis": "file normalize NAME",
     "summary": "Gives the full path with each . and .. removed."
    },
    {
     "synopsis": "file nativename NAME",
     "summary": "Gives a path in the form of the platform."
    },
    {
     "synopsis": "file separator ?NAME?",
     "summary": "Gives the separator of paths."
    },
    {
     "synopsis": "file mkdir ?DIR ...?",
     "summary": "Makes folders, with each missing parent folder."
    },
    {
     "synopsis": "file exists NAME",
     "summary": "Tests whether a file or a folder exists."
    },
    {
     "synopsis": "file isfile NAME",
     "summary": "Tests whether a path is a file."
    },
    {
     "synopsis": "file isdirectory NAME",
     "summary": "Tests whether a path is a folder."
    },
    {
     "synopsis": "file readable NAME",
     "summary": "Tests whether a file can be read."
    },
    {
     "synopsis": "file writable NAME",
     "summary": "Tests whether a file can be written."
    },
    {
     "synopsis": "file executable NAME",
     "summary": "Tests whether a file has a permission to run."
    },
    {
     "synopsis": "file owned NAME",
     "summary": "Tests whether a file exists and is of the user."
    },
    {
     "synopsis": "file size NAME",
     "summary": "Gives the size of a file in bytes."
    },
    {
     "synopsis": "file type NAME",
     "summary": "Gives the kind of an entry of the file system: file, directory, link, and others."
    },
    {
     "synopsis": "file mtime NAME",
     "summary": "Gives the time of the last change of a file, in seconds."
    },
    {
     "synopsis": "file atime NAME",
     "summary": "Gives the time of the last read of a file, in seconds."
    },
    {
     "synopsis": "file stat NAME VAR",
     "summary": "Puts the facts of a file in an array."
    },
    {
     "synopsis": "file lstat NAME VAR",
     "summary": "Puts the facts of a file in an array, for a link itself."
    },
    {
     "synopsis": "file attributes NAME ?OPTION ?VALUE ...??",
     "summary": "Gives or sets the attributes of the platform of a file; not available in ztcl."
    },
    {
     "synopsis": "file copy ?-force? ?--? SOURCE TARGET",
     "summary": "Copies files and folders."
    },
    {
     "synopsis": "file copy ?-force? ?--? SOURCE ?SOURCE ...? DIR",
     "summary": "Copies files and folders."
    },
    {
     "synopsis": "file rename ?-force? ?--? SOURCE TARGET",
     "summary": "Moves or renames files and folders."
    },
    {
     "synopsis": "file rename ?-force? ?--? SOURCE ?SOURCE ...? DIR",
     "summary": "Moves or renames files and folders."
    },
    {
     "synopsis": "file delete ?-force? ?--? ?NAME ...?",
     "summary": "Removes files and folders."
    },
    {
     "synopsis": "file link ?-symbolic|-hard? LINK ?TARGET?",
     "summary": "Makes a link, or gives the target of a link; not available in ztcl."
    },
    {
     "synopsis": "file readlink NAME",
     "summary": "Gives the target of a symbolic link; not available in ztcl."
    },
    {
     "synopsis": "file tempfile ?VAR? ?TEMPLATE?",
     "summary": "Opens a new temporary file and gives its channel."
    },
    {
     "synopsis": "file channels ?PATTERN?",
     "summary": "Gives the names of the open channels."
    },
    {
     "synopsis": "file system NAME",
     "summary": "Gives the file system of a path."
    },
    {
     "synopsis": "file volumes",
     "summary": "Gives the volumes of the file system."
    }
   ],
   "options": [],
   "capability": "file",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "file join notes 2026 a.json",
     "result": "notes/2026/a.json"
    },
    {
     "command": "file extension notes.json",
     "result": ".json"
    },
    {
     "command": "file normalize a/../b/./c",
     "result": "/b/c"
    },
    {
     "command": "file join notes 2026 a.json",
     "result": "notes/2026/a.json"
    },
    {
     "command": "file join a /b c",
     "result": "/b/c"
    },
    {
     "command": "file join a b/ c",
     "result": "a/b/c"
    },
    {
     "command": "file join a ../b",
     "result": "a/../b"
    },
    {
     "command": "file split notes/2026/a.json",
     "result": "notes 2026 a.json"
    },
    {
     "command": "file split /a/b",
     "result": "/ a b"
    },
    {
     "command": "file split a//b/",
     "result": "a b"
    },
    {
     "command": "file dirname notes/2026/a.json",
     "result": "notes/2026"
    },
    {
     "command": "file dirname a.json",
     "result": "."
    },
    {
     "command": "file dirname /a",
     "result": "/"
    },
    {
     "command": "file tail notes/2026/a.json",
     "result": "a.json"
    },
    {
     "command": "file tail notes/",
     "result": "notes"
    },
    {
     "command": "file extension notes.json",
     "result": ".json"
    },
    {
     "command": "file extension notes.tar.gz",
     "result": ".gz"
    },
    {
     "command": "file extension a.b/c",
     "result": ""
    },
    {
     "command": "file extension .hidden",
     "result": ""
    },
    {
     "command": "file rootname notes.tar.gz",
     "result": "notes.tar"
    },
    {
     "command": "file rootname a.b/c",
     "result": "a.b/c"
    },
    {
     "command": "file pathtype a/b",
     "result": "relative"
    },
    {
     "command": "file pathtype /a",
     "result": "absolute"
    },
    {
     "command": "file pathtype ~",
     "result": "relative"
    },
    {
     "command": "file normalize a/../b/./c",
     "result": "/b/c"
    },
    {
     "command": "file normalize /x/y",
     "result": "/x/y"
    },
    {
     "command": "file nativename a/b",
     "result": "a/b"
    },
    {
     "command": "file separator",
     "result": "/"
    },
    {
     "command": "file separator a/b",
     "result": "/"
    },
    {
     "command": "file exists nope.txt",
     "result": "0"
    },
    {
     "command": "file isdirectory nope",
     "result": "0"
    },
    {
     "command": "file readable nope.txt",
     "result": "0"
    },
    {
     "command": "file writable nope.txt",
     "result": "0"
    },
    {
     "command": "file owned nope.txt",
     "result": "0"
    },
    {
     "command": "file delete nope.txt",
     "result": ""
    },
    {
     "command": "catch {file link -symbolic lnk n.txt}",
     "result": "1"
    },
    {
     "command": "catch {file readlink n.txt}",
     "result": "1"
    },
    {
     "command": "lsort [file channels std*]",
     "result": "stderr stdin stdout"
    },
    {
     "command": "file system n.txt",
     "result": "native root"
    },
    {
     "command": "file volumes",
     "result": "/"
    }
   ],
   "errors": [
    {
     "command": "file bogus",
     "message": "unknown or ambiguous subcommand \"bogus\": must be atime, attributes, channels, copy, delete, dirname, executable, exists, extension, isdirectory, isfile, join, link, lstat, mkdir, mtime, nativename, normalize, owned, pathtype, readable, readlink, rename, rootname, separator, size, split, stat, system, tail, tempfile, type, volumes, or writable"
    },
    {
     "command": "file normalize ../../x",
     "message": "couldn't access \"../../x\": permission denied"
    },
    {
     "command": "file join",
     "message": "wrong # args: should be \"file join name ?name ...?\""
    },
    {
     "command": "file split",
     "message": "wrong # args: should be \"file split name\""
    },
    {
     "command": "file dirname",
     "message": "wrong # args: should be \"file dirname name\""
    },
    {
     "command": "file tail",
     "message": "wrong # args: should be \"file tail name\""
    },
    {
     "command": "file extension",
     "message": "wrong # args: should be \"file extension name\""
    },
    {
     "command": "file rootname",
     "message": "wrong # args: should be \"file rootname name\""
    },
    {
     "command": "file pathtype",
     "message": "wrong # args: should be \"file pathtype name\""
    },
    {
     "command": "file normalize ../../x",
     "message": "couldn't access \"../../x\": permission denied"
    },
    {
     "command": "file normalize",
     "message": "wrong # args: should be \"file normalize name\""
    },
    {
     "command": "file nativename",
     "message": "wrong # args: should be \"file nativename name\""
    },
    {
     "command": "file exists",
     "message": "wrong # args: should be \"file exists name\""
    },
    {
     "command": "file isfile",
     "message": "wrong # args: should be \"file isfile name\""
    },
    {
     "command": "file isdirectory",
     "message": "wrong # args: should be \"file isdirectory name\""
    },
    {
     "command": "file readable",
     "message": "wrong # args: should be \"file readable name\""
    },
    {
     "command": "file writable",
     "message": "wrong # args: should be \"file writable name\""
    },
    {
     "command": "file executable",
     "message": "wrong # args: should be \"file executable name\""
    },
    {
     "command": "file owned",
     "message": "wrong # args: should be \"file owned name\""
    },
    {
     "command": "file size nope.txt",
     "message": "could not read \"nope.txt\": no such file or directory"
    },
    {
     "command": "file type nope.txt",
     "message": "could not read \"nope.txt\": no such file or directory"
    },
    {
     "command": "file mtime nope.txt",
     "message": "could not read \"nope.txt\": no such file or directory"
    },
    {
     "command": "file mtime n.txt 1700000000",
     "message": "file mtime with a new time is not available"
    },
    {
     "command": "file atime nope.txt",
     "message": "could not read \"nope.txt\": no such file or directory"
    },
    {
     "command": "file atime n.txt 1700000000",
     "message": "file atime with a new time is not available"
    },
    {
     "command": "file stat nope.txt st",
     "message": "could not read \"nope.txt\": no such file or directory"
    },
    {
     "command": "file stat nope.txt",
     "message": "wrong # args: should be \"file stat name varName\""
    },
    {
     "command": "file lstat nope.txt",
     "message": "wrong # args: should be \"file lstat name varName\""
    },
    {
     "command": "file attributes n.txt",
     "message": "file attributes is not available"
    },
    {
     "command": "file copy nope.txt x.txt",
     "message": "error copying \"nope.txt\": no such file or directory"
    },
    {
     "command": "file copy",
     "message": "wrong # args: should be \"file copy ?-option value ...? source ?source ...? target\""
    },
    {
     "command": "file rename nope.txt z.txt",
     "message": "error renaming \"nope.txt\": no such file or directory"
    },
    {
     "command": "file rename a",
     "message": "wrong # args: should be \"file rename ?-option value ...? source ?source ...? target\""
    },
    {
     "command": "file link -symbolic lnk n.txt",
     "message": "could not link: links are not available in the root folder"
    },
    {
     "command": "file readlink n.txt",
     "message": "could not readlink: links are not available in the root folder"
    },
    {
     "command": "file channels a b",
     "message": "wrong # args: should be \"file channels ?pattern?\""
    }
   ],
   "differences": [
    "Links, the attributes of a file, and a new time with `atime` and `mtime` are errors in ztcl ([issue 687](https://github.com/beetlebugorg/ztcl/issues/687)).",
    "Tcl 9.0.4 has `file home`, `file tempdir`, and `file tildeexpand`, and ztcl has none of them ([issue 685](https://github.com/beetlebugorg/ztcl/issues/685)).",
    "In host mode on Windows, `pathtype`, `nativename`, `separator`, `volumes`, and `system` give the answers of the root folder ([issue 686](https://github.com/beetlebugorg/ztcl/issues/686)).",
    "Many errors have `-errorcode NONE` or a shorter code, where Tcl 8.6.16 and 9.0.4 give a code such as `TCL WRONGARGS` or `TCL LOOKUP SUBCOMMAND` ([issue 658](https://github.com/beetlebugorg/ztcl/issues/658))."
   ],
   "page": "https://beetlebug.org/ztcl/reference/file/"
  },
  {
   "name": "open",
   "area": "channels",
   "synopsis": [
    "open fileName ?access? ?permissions?"
   ],
   "summary": "Opens a file and gives a channel name. access is `r` (the default), `w` (a new file), `a` (add at the end), `r+`, `w+`, or `a+`, or a list of flags such as `{WRONLY CREAT}`. permissions is the mode of a new file, 0666 by default. A name that starts with `|` is a command pipeline, as for `exec`, with the capability `exec`. The words `-vm VM` at the start of the pipeline run it in a guest of `ztcl::vm`, as `exec -vm` does.",
   "names": [
    "open"
   ],
   "subcommands": [],
   "options": [],
   "capability": "channels",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "set f [open notes.txt w]; puts $f \"buy milk\"; close $f",
     "result": ""
    },
    {
     "command": "set f [open notes.txt]; set t [gets $f]; close $f; set t",
     "result": "buy milk"
    }
   ],
   "errors": [
    {
     "command": "open nope.txt",
     "message": "couldn't open \"nope.txt\": no such file or directory"
    }
   ],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/open/"
  },
  {
   "name": "close",
   "area": "channels",
   "synopsis": [
    "close channelId ?direction?"
   ],
   "summary": "Writes what is left in the buffer and closes the channel. direction `read` or `write` closes one side of a socket or a pipe.",
   "names": [
    "close"
   ],
   "subcommands": [],
   "options": [],
   "capability": "channels",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/close/"
  },
  {
   "name": "gets",
   "area": "channels",
   "synopsis": [
    "gets channelId ?varName?"
   ],
   "summary": "Reads one line with no newline. With varName, it puts the line in the variable and gives its length, or -1 at the end of the input. Without varName, it gives the line.",
   "names": [
    "gets"
   ],
   "subcommands": [],
   "options": [],
   "capability": "channels",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "set f [open t.txt w]; puts $f \"a\\nb\"; close $f; set f [open t.txt]; set n 0; while {[gets $f line] >= 0} {incr n}; close $f; set n",
     "result": "2"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/gets/"
  },
  {
   "name": "read",
   "area": "channels",
   "synopsis": [
    "read ?-nonewline? channelId ?numChars?"
   ],
   "summary": "Reads numChars characters, or all of the input to its end. `-nonewline` removes the last newline.",
   "names": [
    "read"
   ],
   "subcommands": [],
   "options": [],
   "capability": "channels",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/read/"
  },
  {
   "name": "puts",
   "area": "channels",
   "synopsis": [
    "puts ?-nonewline? ?channelId? string"
   ],
   "summary": "Writes the string and a newline. The default channel is `stdout`. In an interpreter with no channels, `puts` goes to a callback of the host, and `stdout` and `stderr` are the only channel names.",
   "names": [
    "puts"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "puts -nonewline \"no newline\"",
     "result": ""
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/puts/"
  },
  {
   "name": "flush",
   "area": "channels",
   "synopsis": [
    "flush channelId"
   ],
   "summary": "Writes the buffer of the channel now.",
   "names": [
    "flush"
   ],
   "subcommands": [],
   "options": [],
   "capability": "channels",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/flush/"
  },
  {
   "name": "eof",
   "area": "channels",
   "synopsis": [
    "eof channelId"
   ],
   "summary": "1 after a read reached the end of the input.",
   "names": [
    "eof"
   ],
   "subcommands": [],
   "options": [],
   "capability": "channels",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/eof/"
  },
  {
   "name": "seek",
   "area": "channels",
   "synopsis": [
    "seek channelId offset ?origin?"
   ],
   "summary": "Moves the place of the next read or write. origin is `start` (the default), `current`, or `end`.",
   "names": [
    "seek"
   ],
   "subcommands": [],
   "options": [],
   "capability": "channels",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/seek/"
  },
  {
   "name": "tell",
   "area": "channels",
   "synopsis": [
    "tell channelId"
   ],
   "summary": "The place of the next read or write, in bytes from the start.",
   "names": [
    "tell"
   ],
   "subcommands": [],
   "options": [],
   "capability": "channels",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/tell/"
  },
  {
   "name": "fconfigure",
   "area": "channels",
   "synopsis": [
    "fconfigure channelId ?-option value ...?"
   ],
   "summary": "Gives or sets the options of a channel: `-blocking`, `-buffering` (`full`, `line`, or `none`), `-buffersize`, `-encoding` (`utf-8`, `binary`, `ascii`, `unicode`, or an encoding file of `encoding dirs`), `-translation` (`auto`, `lf`, `crlf`, or `binary`), and `-eofchar`. In Tcl 9.1 a channel also has `-profile` (`strict` by default, `replace`, or `tcl8`): with `strict`, bad UTF-8 input is an error of the read. A socket also has `-sockname` and `-peername`. A serial port has the options below. `chan configure` is the same command.",
   "names": [
    "fconfigure"
   ],
   "subcommands": [],
   "options": [
    {
     "option": "-mode baud,parity,data,stop",
     "summary": "A serial port: the baud, the parity (`n`, `o`, `e`, `m`, or `s`), the data bits (5 to 8), and the stop bits (1 or 2), for example `115200,n,8,1`. Linux takes any baud. macOS has no `m` or `s`."
    },
    {
     "option": "-handshake type",
     "summary": "A serial port: `none`, `rtscts`, `xonxoff`, or `dtrdsr` (Windows only). It sets the flow control. A read gives no value."
    },
    {
     "option": "-xchar {xon xoff}",
     "summary": "A serial port: the two characters of `xonxoff`."
    },
    {
     "option": "-ttycontrol {signal value ...}",
     "summary": "A serial port: sets the lines `RTS`, `DTR`, and `BREAK`, for example `{DTR 0 RTS 1}`. A read gives no value."
    },
    {
     "option": "-ttystatus",
     "summary": "A serial port, read only: a dict of the lines `CTS`, `DSR`, `RING`, and `DCD`."
    },
    {
     "option": "-queue",
     "summary": "A serial port, read only: the counts of bytes in the input queue and the output queue of the system."
    }
   ],
   "capability": "channels",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/fconfigure/"
  },
  {
   "name": "fblocked",
   "area": "channels",
   "synopsis": [
    "fblocked channelId"
   ],
   "summary": "1 when the last read of a channel that does not block had no full line.",
   "names": [
    "fblocked"
   ],
   "subcommands": [],
   "options": [],
   "capability": "channels",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/fblocked/"
  },
  {
   "name": "fcopy",
   "area": "channels",
   "synopsis": [
    "fcopy input output ?-size size? ?-command callback?"
   ],
   "summary": "Copies from one channel to another. With `-command`, the copy runs in the event loop, and the callback gets the count of bytes.",
   "names": [
    "fcopy"
   ],
   "subcommands": [],
   "options": [],
   "capability": "channels",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/fcopy/"
  },
  {
   "name": "source",
   "area": "channels",
   "synopsis": [
    "source ?-encoding name? fileName"
   ],
   "summary": "Runs the script in a file, and gives the result of its last command. `-encoding` names the encoding of the file. The default is `utf-8`. A byte order mark at the start of the file is not part of the script, and the character ^Z ends the script.",
   "names": [
    "source"
   ],
   "subcommands": [],
   "options": [],
   "capability": "channels",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/source/"
  },
  {
   "name": "glob",
   "area": "channels",
   "synopsis": [
    "glob ?switches? name ?name ...?"
   ],
   "summary": "The names of the files that match glob patterns. In Tcl 8.6 a pattern with no match is an error, unless `-nocomplain`. In Tcl 9.1 it gives an empty list.",
   "names": [
    "glob"
   ],
   "subcommands": [],
   "options": [
    {
     "option": "-nocomplain",
     "summary": "No match gives an empty list."
    },
    {
     "option": "-directory DIR",
     "summary": "Matches in DIR."
    },
    {
     "option": "-types TYPES",
     "summary": "Only files of the types, such as `f` and `d`."
    },
    {
     "option": "-tails",
     "summary": "Gives the names without the folder of `-directory`."
    }
   ],
   "capability": "file",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/glob/"
  },
  {
   "name": "cd",
   "area": "channels",
   "synopsis": [
    "cd ?dirName?"
   ],
   "summary": "Changes the working folder, inside the root folder of the interpreter.",
   "names": [
    "cd"
   ],
   "subcommands": [],
   "options": [],
   "capability": "file",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/cd/"
  },
  {
   "name": "pwd",
   "area": "channels",
   "synopsis": [
    "pwd"
   ],
   "summary": "The working folder.",
   "names": [
    "pwd"
   ],
   "subcommands": [],
   "options": [],
   "capability": "file",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/pwd/"
  },
  {
   "name": "zipfs",
   "area": "channels",
   "synopsis": [
    "zipfs subcommand ?arg ...?"
   ],
   "summary": "The zip file systems under `//zipfs:/`. A binary of `ztcl build` has its files at `//zipfs:/app/`.",
   "names": [
    "zipfs"
   ],
   "subcommands": [
    {
     "synopsis": "zipfs mount ?ZIPFILE? ?MOUNTPOINT?",
     "summary": "Mounts a zip file, or gives the mounts."
    },
    {
     "synopsis": "zipfs unmount MOUNTPOINT",
     "summary": "Removes a mount."
    },
    {
     "synopsis": "zipfs list ?(-glob|-regexp)? ?PATTERN?",
     "summary": "The names of the files in the mounts."
    },
    {
     "synopsis": "zipfs exists NAME",
     "summary": "1 when the file is in a mount."
    },
    {
     "synopsis": "zipfs info NAME",
     "summary": "The zip file, the size, the packed size, and the offset of a file."
    },
    {
     "synopsis": "zipfs root",
     "summary": "The root of the mounts: `//zipfs:/`."
    }
   ],
   "options": [],
   "capability": "file",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/zipfs/"
  },
  {
   "name": "socket",
   "area": "channels",
   "synopsis": [
    "socket ?-myaddr addr? ?-myport myport? ?-async? host port",
    "socket -server command ?-myaddr addr? port"
   ],
   "summary": "Opens a TCP connection and gives a channel, or with `-server` makes a server that calls the command with a channel, an address, and a port for each new connection. Port 0 asks the system for a free port. Each address goes through the network policy of the host: loopback only by default.",
   "names": [
    "socket"
   ],
   "subcommands": [],
   "options": [],
   "capability": "socket",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/socket/"
  },
  {
   "name": "after",
   "area": "events",
   "synopsis": [
    "after ms ?script ...?",
    "after cancel id|script",
    "after idle script ?script ...?",
    "after info ?id?"
   ],
   "summary": "With a script, runs it from the event loop after ms milliseconds and gives an id. With no script, waits ms milliseconds. `after idle` runs the script when the loop has no other work. The script runs at the top level: build it with `list`. In the shell of the site, the loop runs on a virtual clock, so a wait ends at once.",
   "names": [
    "after"
   ],
   "subcommands": [],
   "options": [],
   "capability": "event",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "after 10 {set ::done 1}; vwait done; set done",
     "result": "1"
    }
   ],
   "errors": [
    {
     "command": "after nope",
     "message": "bad argument \"nope\": must be cancel, idle, info, or an integer"
    }
   ],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/after/"
  },
  {
   "name": "vwait",
   "area": "events",
   "synopsis": [
    "vwait varName"
   ],
   "summary": "Runs the event loop until the variable is set.",
   "names": [
    "vwait"
   ],
   "subcommands": [],
   "options": [],
   "capability": "event",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/vwait/"
  },
  {
   "name": "update",
   "area": "events",
   "synopsis": [
    "update ?idletasks?"
   ],
   "summary": "Runs each event that is ready, and returns. `idletasks` runs only the scripts of `after idle`.",
   "names": [
    "update"
   ],
   "subcommands": [],
   "options": [],
   "capability": "event",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/update/"
  },
  {
   "name": "fileevent",
   "area": "events",
   "synopsis": [
    "fileevent channelId event ?script?"
   ],
   "summary": "Runs the script from the event loop when the channel is `readable` or `writable`. An empty script removes the handler. `chan event` is the same command in Tcl.",
   "names": [
    "fileevent"
   ],
   "subcommands": [],
   "options": [],
   "capability": "event",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/fileevent/"
  },
  {
   "name": "tcl::Bgerror",
   "area": "events",
   "synopsis": [
    "tcl::Bgerror message options"
   ],
   "summary": "The default handler of an error in a script that the event loop runs. It calls `bgerror` with the message when a proc of that name exists.",
   "names": [
    "tcl::Bgerror",
    "bgerror"
   ],
   "subcommands": [],
   "options": [],
   "capability": "event",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/tcl-Bgerror/"
  },
  {
   "name": "interp",
   "area": "interps",
   "synopsis": [
    "interp cmd ?arg ...?"
   ],
   "summary": "Makes and runs child interpreters. A child has its own commands and variables, and never more capabilities than its parent. An alias is a command of a child that runs a command of the parent, and is the way to give a child one exact power.",
   "names": [
    "interp"
   ],
   "subcommands": [
    {
     "synopsis": "interp create ?-safe? ?-meter NAME? ?--? ?PATH?",
     "summary": "A new child, and its path. `-meter` (capability `meter`) counts the child in a meter of `ztcl::meter`."
    },
    {
     "synopsis": "interp eval PATH ARG ?ARG ...?",
     "summary": "Runs a script in the child."
    },
    {
     "synopsis": "interp alias SRCPATH SRCCMD TARGETPATH TARGETCMD ?ARG ...?",
     "summary": "Makes SRCCMD of the child run TARGETCMD of the parent."
    },
    {
     "synopsis": "interp aliases ?PATH?",
     "summary": "The aliases of a child."
    },
    {
     "synopsis": "interp delete ?PATH ...?",
     "summary": "Removes children."
    },
    {
     "synopsis": "interp exists PATH",
     "summary": "1 when the child exists."
    },
    {
     "synopsis": "interp children ?PATH?",
     "summary": "The children."
    },
    {
     "synopsis": "interp cancel ?-unwind? ?--? ?PATH? ?RESULT?",
     "summary": "Stops the script of the interp with the error \"eval canceled\", or RESULT. With -unwind, `catch` does not stop the error."
    },
    {
     "synopsis": "interp slaves ?PATH?",
     "summary": "The old name of `children`."
    },
    {
     "synopsis": "interp issafe ?PATH?",
     "summary": "1 for a safe interpreter."
    },
    {
     "synopsis": "interp hide PATH CMD ?NAME?",
     "summary": "Hides a command from the scripts of the child."
    },
    {
     "synopsis": "interp expose PATH NAME ?CMD?",
     "summary": "Makes a hidden command visible again."
    },
    {
     "synopsis": "interp hidden ?PATH?",
     "summary": "The hidden commands."
    },
    {
     "synopsis": "interp invokehidden PATH ?-global? NAME ?ARG ...?",
     "summary": "Runs a hidden command."
    },
    {
     "synopsis": "interp marktrusted PATH",
     "summary": "Makes a safe child trusted."
    },
    {
     "synopsis": "interp recursionlimit PATH ?N?",
     "summary": "The nesting limit of the child."
    },
    {
     "synopsis": "interp target PATH ALIAS",
     "summary": "The target of an alias."
    }
   ],
   "options": [],
   "capability": "interp",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "set c [interp create]; interp eval $c {expr {6 * 7}}",
     "result": "42"
    },
    {
     "command": "interp alias $c double {} apply {{x} {expr {$x * 2}}}; interp eval $c {double 4}",
     "result": "8"
    }
   ],
   "errors": [],
   "differences": [
    "`interp limit` is not in ztcl. Each interpreter has the compute limit and the memory limit of the host instead."
   ],
   "page": "https://beetlebug.org/ztcl/reference/interp/"
  },
  {
   "name": "package",
   "area": "interps",
   "synopsis": [
    "package option ?arg ...?"
   ],
   "summary": "Loads packages by name and version. With the capabilities package and file, the handler `tclPkgUnknown` reads the `pkgIndex.tcl` file of each folder of `auto_path` and of each folder in it, as Tcl does. A script can also run `package ifneeded` itself. A build with modules loads the built-in `ztcl::` modules by name. With no capability, only `names`, `present`, `provide`, `require`, and `versions` exist.",
   "names": [
    "package"
   ],
   "subcommands": [
    {
     "synopsis": "package require ?-exact? NAME ?VERSION ...?",
     "summary": "Loads a package and gives its version."
    },
    {
     "synopsis": "package provide NAME ?VERSION?",
     "summary": "Says that the package is loaded, or gives its version."
    },
    {
     "synopsis": "package ifneeded NAME VERSION ?SCRIPT?",
     "summary": "The script that loads a version."
    },
    {
     "synopsis": "package present ?-exact? NAME ?VERSION?",
     "summary": "The version of a loaded package, or an error."
    },
    {
     "synopsis": "package names",
     "summary": "The names of the known packages."
    },
    {
     "synopsis": "package versions NAME",
     "summary": "The versions of a package that `ifneeded` knows."
    },
    {
     "synopsis": "package forget ?NAME ...?",
     "summary": "Forgets packages."
    },
    {
     "synopsis": "package vcompare V1 V2",
     "summary": "-1, 0, or 1."
    },
    {
     "synopsis": "package vsatisfies VERSION REQ ?REQ ...?",
     "summary": "1 when VERSION fits a requirement such as `1.2`, `1.2-`, or `1.2-2.0`."
    },
    {
     "synopsis": "package prefer ?latest|stable?",
     "summary": "Which versions `require` picks."
    },
    {
     "synopsis": "package unknown ?CMD?",
     "summary": "The command that runs for a missing package."
    }
   ],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "package require ztcl::json",
     "result": "1.0"
    },
    {
     "command": "package provide jot 0.1.0; package present jot",
     "result": "0.1.0"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/package/"
  },
  {
   "name": "safe::interpCreate",
   "area": "interps",
   "synopsis": [
    "safe::interpCreate ?child? ?-accessPath LIST? ?-statics BOOL? ?-noStatics? ?-nested BOOL? ?-nestedLoadOk? ?-deleteHook SCRIPT?"
   ],
   "summary": "The safe package 0.10 of the Tcl library (the Safe Base), which loads at the first call of one of its commands: a safe child with aliases into the parent for `source`, `load`, `glob`, `encoding`, `exit`, `clock`, and the `file` subcommands that read no file. The child sees each directory of its access path only as a token, `$p(:N:)`. An alias turns the tokens back into the directories and checks each path against the access path. `interpInit` sets up a child that exists, `interpConfigure` reads or changes the options, `interpAddToAccessPath` and `interpFindInAccessPath` give the token of a directory, `interpDelete` runs the delete hook and deletes the child, and `setLogCmd` sets a command for the messages of each check.",
   "names": [
    "safe::interpCreate",
    "safe::interpInit",
    "safe::interpConfigure",
    "safe::interpDelete",
    "safe::interpAddToAccessPath",
    "safe::interpFindInAccessPath",
    "safe::setLogCmd"
   ],
   "subcommands": [],
   "options": [],
   "capability": "package",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "set c [safe::interpCreate -accessPath {/a /b}]; safe::interpFindInAccessPath $c /b",
     "result": "$p(:1:)"
    },
    {
     "command": "interp eval $c {expr {6 * 7}}",
     "result": "42"
    }
   ],
   "errors": [],
   "differences": [
    "A safe child of ztcl has no hidden commands, so the source alias reads the file in the parent and evaluates its text in the child. The child has the small `package` command, which runs no `ifneeded` script."
   ],
   "page": "https://beetlebug.org/ztcl/reference/safe-interpCreate/"
  },
  {
   "name": "tclPkgUnknown",
   "area": "interps",
   "synopsis": [
    "tclPkgUnknown name ?version ...?"
   ],
   "summary": "The handler of `package unknown`: sources the `pkgIndex.tcl` file of each folder of `auto_path` and of each folder in it, once. A `pkgIndex.tcl` runs with the variable `dir` set to its folder.",
   "names": [
    "tclPkgUnknown",
    "tclPkgUnknown",
    "tclPkgSetup",
    "tclLog"
   ],
   "subcommands": [],
   "options": [],
   "capability": "package",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/tclPkgUnknown/"
  },
  {
   "name": "tcl::tm::path",
   "area": "interps",
   "synopsis": [
    "tcl::tm::path add ?path ...?",
    "tcl::tm::path remove ?path ...?",
    "tcl::tm::path list",
    "tcl::tm::roots paths"
   ],
   "summary": "The module path of Tcl modules. A module is a file `NAME-VERSION.tm` in a folder of the path, with each `::` of the package name as a folder, and `package require` sources it. `add` puts folders at the head of the path; a folder that is an ancestor or a subfolder of another folder of the path is an error. `roots` adds `ROOT/tcl8/site-tcl` and `ROOT/tcl8/8.0` to `ROOT/tcl8/8.6` for each root. The handler of `package unknown` searches the path first, then the `pkgIndex.tcl` files of `auto_path`.",
   "names": [
    "tcl::tm::path",
    "tcl::tm::roots",
    "tcl::tm::UnknownHandler"
   ],
   "subcommands": [],
   "options": [],
   "capability": "package",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "foreach p [tcl::tm::path list] {tcl::tm::path remove $p}; tcl::tm::path add /a /b; tcl::tm::path list",
     "result": "/b /a"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/tcl-tm-path/"
  },
  {
   "name": "pkg_mkIndex",
   "area": "interps",
   "synopsis": [
    "pkg_mkIndex ?-direct? ?-lazy? ?-load PATTERN? ?-verbose? ?--? dir ?pattern ...?"
   ],
   "summary": "Writes the `pkgIndex.tcl` file of a folder, as Tcl does. Each file of the patterns (the default is `*.tcl` and the files of shared libraries) goes into a new child interpreter, which notes the packages that the file provides and the commands that it makes. A file that fails goes again after the others, with the packages that the others provide. `-direct` (the default) gives an ifneeded script that sources the files, and `-lazy` one that puts the commands in `auto_index` through `tclPkgSetup`. `pkg::create` gives one line of such an index.",
   "names": [
    "pkg_mkIndex",
    "pkg::create",
    "tcl::Pkg::CompareExtension",
    "tcl::Pkg::Index"
   ],
   "subcommands": [],
   "options": [],
   "capability": "package",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "pkg::create -name foo -version 1.0 -source foo.tcl",
     "result": "package ifneeded foo 1.0 [list source [file join $dir foo.tcl]]"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/pkg_mkIndex/"
  },
  {
   "name": "auto_mkindex",
   "area": "interps",
   "synopsis": [
    "auto_mkindex dir ?pattern ...?"
   ],
   "summary": "Writes the `tclIndex` file of a folder for `auto_load`, as Tcl does. Each file of the patterns (the default is `*.tcl`) is read as Tcl text, and no command of it runs: `proc` defines a command, `namespace eval` goes into its body with that namespace, and `namespace ensemble create` defines the command of the namespace. `auto_mkindex_parser::command NAME ARGS BODY` adds a handler for a command of the files, which can append lines to the variable `index`.",
   "names": [
    "auto_mkindex",
    "auto_mkindex_parser::command",
    "auto_mkindex_parser::fullname",
    "auto_mkindex_parser::slavehook"
   ],
   "subcommands": [],
   "options": [],
   "capability": "package",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [
    "The commands of `auto_mkindex_parser::slavehook` run nowhere, since the parse runs no command of a file."
   ],
   "page": "https://beetlebug.org/ztcl/reference/auto_mkindex/"
  },
  {
   "name": "auto_load",
   "area": "interps",
   "synopsis": [
    "auto_load command ?namespace?"
   ],
   "summary": "Defines a command from `auto_index`, which the `tclIndex` files of `auto_path` and `tclPkgSetup` (the lazy `pkgIndex.tcl` form) fill. Gives 1 when the command exists after it. The `unknown` command calls it for a missing command.",
   "names": [
    "auto_load",
    "auto_load",
    "auto_load_index",
    "auto_reset",
    "auto_qualify",
    "auto_import",
    "auto_execok"
   ],
   "subcommands": [],
   "options": [],
   "capability": "package",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "auto_qualify foo ::bar",
     "result": "::bar::foo foo"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/auto_load/"
  },
  {
   "name": "history",
   "area": "interps",
   "synopsis": [
    "history ?option? ?arg ...?"
   ],
   "summary": "The list of the commands of a session, as in Tcl: `add`, `change`, `clear`, `event`, `info`, `keep`, `nextid`, and `redo`.",
   "names": [
    "history"
   ],
   "subcommands": [],
   "options": [],
   "capability": "package",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "history add {set a 1}; history nextid",
     "result": "2"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/history/"
  },
  {
   "name": "oo::class",
   "area": "objects",
   "synopsis": [
    "oo::class create name ?definition?",
    "oo::class new ?definition?"
   ],
   "summary": "Makes a class. The definition is a script of `oo::define` commands: `constructor`, `destructor`, `method`, `variable`, `superclass`, `mixin`, `filter`, `export`, and `unexport`. A class is an object with the methods `create`, `new`, and `destroy`. `cls create NAME ARGS` makes an object with a name, and `cls new ARGS` makes one with a name that ztcl picks.",
   "names": [
    "oo::class",
    "oo::object"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "oo::class create Note {variable text; constructor {t} {set text $t}; method show {} {return \"note: $text\"}}",
     "result": "::Note"
    },
    {
     "command": "Note create milk \"buy milk\"; milk show",
     "result": "note: buy milk"
    }
   ],
   "errors": [
    {
     "command": "milk nope",
     "message": "unknown method \"nope\": must be destroy or show"
    }
   ],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/oo-class/"
  },
  {
   "name": "oo::define",
   "area": "objects",
   "synopsis": [
    "oo::define className arg ?arg ...?"
   ],
   "summary": "Changes the definition of a class. A change goes to each object of the class at once.",
   "names": [
    "oo::define",
    "oo::define::constructor",
    "oo::define::deletemethod",
    "oo::define::destructor",
    "oo::define::export",
    "oo::define::filter",
    "oo::define::forward",
    "oo::define::method",
    "oo::define::mixin",
    "oo::define::renamemethod",
    "oo::define::self",
    "oo::define::superclass",
    "oo::define::unexport",
    "oo::define::variable"
   ],
   "subcommands": [
    {
     "synopsis": "constructor ARGS BODY",
     "summary": "The code that runs when an object is made."
    },
    {
     "synopsis": "destructor BODY",
     "summary": "The code that runs when an object is removed."
    },
    {
     "synopsis": "method NAME ARGS BODY",
     "summary": "A method. A name that starts with a lowercase letter is exported."
    },
    {
     "synopsis": "variable ?NAME ...?",
     "summary": "Variables that each method sees with no `my variable`."
    },
    {
     "synopsis": "superclass ?CLASS ...?",
     "summary": "The parent classes."
    },
    {
     "synopsis": "mixin ?CLASS ...?",
     "summary": "Classes whose methods come before the methods of the class."
    },
    {
     "synopsis": "filter ?METHOD ...?",
     "summary": "Methods that run around each call."
    },
    {
     "synopsis": "forward NAME CMD ?ARG ...?",
     "summary": "A method that runs a command."
    },
    {
     "synopsis": "export NAME ?NAME ...?",
     "summary": "Makes methods callable from outside."
    },
    {
     "synopsis": "unexport NAME ?NAME ...?",
     "summary": "Makes methods callable only with `my`."
    },
    {
     "synopsis": "deletemethod NAME ?NAME ...?",
     "summary": "Removes methods."
    },
    {
     "synopsis": "renamemethod OLD NEW",
     "summary": "Gives a method a new name."
    },
    {
     "synopsis": "self SCRIPT",
     "summary": "Changes the definition of the class object itself."
    }
   ],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "oo::class create A; oo::define A method hi {} {return hi}; [A new] hi",
     "result": "hi"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/oo-define/"
  },
  {
   "name": "oo::objdefine",
   "area": "objects",
   "synopsis": [
    "oo::objdefine object arg ?arg ...?"
   ],
   "summary": "Changes the definition of one object, with the words of `oo::define` and `class` to change its class.",
   "names": [
    "oo::objdefine",
    "oo::objdefine::class",
    "oo::objdefine::deletemethod",
    "oo::objdefine::export",
    "oo::objdefine::filter",
    "oo::objdefine::forward",
    "oo::objdefine::method",
    "oo::objdefine::mixin",
    "oo::objdefine::renamemethod",
    "oo::objdefine::unexport",
    "oo::objdefine::variable"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/oo-objdefine/"
  },
  {
   "name": "oo::copy",
   "area": "objects",
   "synopsis": [
    "oo::copy sourceObject ?targetObject?"
   ],
   "summary": "Makes a new object with the class, the methods, and the variables of an object.",
   "names": [
    "oo::copy"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/oo-copy/"
  },
  {
   "name": "my",
   "area": "objects",
   "synopsis": [
    "my methodName ?arg ...?"
   ],
   "summary": "In a method, calls a method of the same object, also one that is not exported.",
   "names": [
    "my"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/my/"
  },
  {
   "name": "self",
   "area": "objects",
   "synopsis": [
    "self ?subcommand?"
   ],
   "summary": "In a method, gives facts about the call: `self` or `self object` is the name of the object, `self class` the class of the method, `self method` the name of the method, and `self next` the next method of the chain.",
   "names": [
    "self",
    "oo::Helpers::self"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [
    {
     "command": "oo::class create T; self",
     "message": "self may only be called from inside a method"
    }
   ],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/self/"
  },
  {
   "name": "next",
   "area": "objects",
   "synopsis": [
    "next ?arg ...?"
   ],
   "summary": "In a method, calls the method of the same name of the next class of the chain, such as the parent class, and gives its result. `nextto CLASS` calls the method of one class of the chain.",
   "names": [
    "next",
    "nextto",
    "oo::Helpers::next",
    "oo::Helpers::nextto"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/next/"
  },
  {
   "name": "thread",
   "area": "threads",
   "synopsis": [
    "thread::create ?-joinable? ?-preserved? ?-isolation LEVEL? ?-caps LIST? ?-compute UNITS? ?-meter NAME? ?script?"
   ],
   "summary": "The `thread` package: a thread is one interpreter that runs a script, with its own limits. Threads talk with messages: `thread::send` runs a script in another thread. Each thread of a group gets the limits of the host, and the group has totals.",
   "names": [
    "thread",
    "thread::attach",
    "thread::broadcast",
    "thread::cancel",
    "thread::cond",
    "thread::configure",
    "thread::create",
    "thread::detach",
    "thread::errorproc",
    "thread::eval",
    "thread::exists",
    "thread::exit",
    "thread::id",
    "thread::join",
    "thread::mutex",
    "thread::names",
    "thread::preserve",
    "thread::release",
    "thread::rwmutex",
    "thread::send",
    "thread::transfer",
    "thread::unwind",
    "thread::wait"
   ],
   "subcommands": [
    {
     "synopsis": "thread::create ?-joinable? ?-preserved? ?-isolation LEVEL? ?-caps LIST? ?-compute UNITS? ?-meter NAME? ?SCRIPT?",
     "summary": "A new thread that runs SCRIPT, and its id. With no SCRIPT, it waits for messages. `-isolation process` runs it in a child process, and `-isolation vm` in a guest of `ztcl::vm`. `-compute` caps its compute units, and `-meter` (capability `meter`) counts it in a meter of `ztcl::meter`. `-caps` gives the thread only the listed capabilities of its creator."
    },
    {
     "synopsis": "thread::send ?-async? ?-head? ID SCRIPT ?VAR?",
     "summary": "Runs SCRIPT in the thread and gives its result. With `-async`, it does not wait."
    },
    {
     "synopsis": "thread::broadcast SCRIPT",
     "summary": "Sends SCRIPT to each other thread."
    },
    {
     "synopsis": "thread::wait",
     "summary": "Runs the event loop of the thread until `thread::release`."
    },
    {
     "synopsis": "thread::id",
     "summary": "The id of this thread."
    },
    {
     "synopsis": "thread::names",
     "summary": "The ids of the threads."
    },
    {
     "synopsis": "thread::exists ID",
     "summary": "1 when the thread exists."
    },
    {
     "synopsis": "thread::join ID",
     "summary": "Waits for a joinable thread to end."
    },
    {
     "synopsis": "thread::preserve ?ID?",
     "summary": "Adds a reference. `thread::release` removes one, and the thread ends at zero."
    },
    {
     "synopsis": "thread::release ?-wait? ?ID?",
     "summary": "Takes a reference away."
    },
    {
     "synopsis": "thread::cancel ?-unwind? ID ?RESULT?",
     "summary": "Stops the script that runs in a thread."
    },
    {
     "synopsis": "thread::unwind",
     "summary": "Ends `thread::wait` of this thread."
    },
    {
     "synopsis": "thread::exit ?STATUS?",
     "summary": "Ends this thread."
    },
    {
     "synopsis": "thread::configure ID ?OPTION? ?VALUE?",
     "summary": "The options of a thread, such as `-eventmark`."
    },
    {
     "synopsis": "thread::errorproc ?PROC?",
     "summary": "The proc for errors of scripts of `-async` sends."
    },
    {
     "synopsis": "thread::transfer ID CHANNEL",
     "summary": "Moves a channel to a thread. `thread::detach` and `thread::attach` do it in two steps."
    },
    {
     "synopsis": "thread::mutex create|destroy|lock|unlock ?ID?",
     "summary": "Mutexes. `thread::rwmutex` has read and write locks, and `thread::cond` condition variables."
    },
    {
     "synopsis": "thread::eval ?-lock MUTEX? SCRIPT",
     "summary": "Runs SCRIPT with a mutex locked."
    }
   ],
   "options": [],
   "capability": "thread",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [
    "The isolation levels of `-isolation` are from ztcl. See [Threads](../../threads.md)."
   ],
   "page": "https://beetlebug.org/ztcl/reference/thread/"
  },
  {
   "name": "tsv",
   "area": "threads",
   "synopsis": [
    "tsv::set array element ?value?"
   ],
   "summary": "Shared variables for threads: arrays that each thread of the process can read and change, with a lock for each command. The list commands change a list in place.",
   "names": [
    "tsv",
    "tsv::append",
    "tsv::array",
    "tsv::exists",
    "tsv::get",
    "tsv::handlers",
    "tsv::incr",
    "tsv::keyldel",
    "tsv::keylget",
    "tsv::keylkeys",
    "tsv::keylset",
    "tsv::lappend",
    "tsv::lindex",
    "tsv::linsert",
    "tsv::llength",
    "tsv::lock",
    "tsv::lpop",
    "tsv::lpush",
    "tsv::lrange",
    "tsv::lreplace",
    "tsv::lsearch",
    "tsv::lset",
    "tsv::move",
    "tsv::names",
    "tsv::object",
    "tsv::pop",
    "tsv::set",
    "tsv::unset"
   ],
   "subcommands": [
    {
     "synopsis": "tsv::set ARRAY ELEMENT ?VALUE?",
     "summary": "Sets or gives a value."
    },
    {
     "synopsis": "tsv::get ARRAY ELEMENT ?VAR?",
     "summary": "The value. With VAR, 1 when it exists and the value in VAR."
    },
    {
     "synopsis": "tsv::exists ARRAY ?ELEMENT?",
     "summary": "1 when it exists."
    },
    {
     "synopsis": "tsv::unset ARRAY ?ELEMENT ...?",
     "summary": "Removes elements or the array."
    },
    {
     "synopsis": "tsv::incr ARRAY ELEMENT ?N?",
     "summary": "Adds to an integer."
    },
    {
     "synopsis": "tsv::append ARRAY ELEMENT VALUE ...",
     "summary": "Adds text."
    },
    {
     "synopsis": "tsv::lappend ARRAY ELEMENT VALUE ...",
     "summary": "Adds list elements. `lindex`, `llength`, `lrange`, `linsert`, `lreplace`, `lsearch`, `lset`, `lpush`, and `lpop` work as the list commands."
    },
    {
     "synopsis": "tsv::pop ARRAY ELEMENT",
     "summary": "The value, and removes it."
    },
    {
     "synopsis": "tsv::move ARRAY OLD NEW",
     "summary": "Gives an element a new name."
    },
    {
     "synopsis": "tsv::names ?PATTERN?",
     "summary": "The names of the arrays."
    },
    {
     "synopsis": "tsv::array set|get|names|size|reset ARRAY ...",
     "summary": "Commands on a whole array."
    },
    {
     "synopsis": "tsv::lock ARRAY ARG ?ARG ...?",
     "summary": "Runs a script with the lock of the array."
    },
    {
     "synopsis": "tsv::keylset ARRAY ELEMENT KEY VALUE",
     "summary": "Keyed lists: `keylget`, `keylkeys`, and `keyldel` go with it."
    },
    {
     "synopsis": "tsv::object ARRAY ELEMENT",
     "summary": "A command for one element."
    },
    {
     "synopsis": "tsv::handlers",
     "summary": "The names of the storage handlers."
    }
   ],
   "options": [],
   "capability": "thread",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/tsv/"
  },
  {
   "name": "tpool",
   "area": "threads",
   "synopsis": [
    "tpool::create ?-minworkers N? ?-maxworkers N? ?-idletime S? ?-initcmd SCRIPT? ?-exitcmd SCRIPT?"
   ],
   "summary": "Thread pools: a group of worker threads that run jobs. `tpool::post` gives a job and gets a job id, and `tpool::wait` and `tpool::get` give the results.",
   "names": [
    "tpool",
    "tpool::cancel",
    "tpool::create",
    "tpool::get",
    "tpool::names",
    "tpool::post",
    "tpool::preserve",
    "tpool::release",
    "tpool::resume",
    "tpool::suspend",
    "tpool::wait"
   ],
   "subcommands": [
    {
     "synopsis": "tpool::create ?OPTIONS?",
     "summary": "A new pool, and its id."
    },
    {
     "synopsis": "tpool::post ?-detached? ?-nowait? POOL SCRIPT",
     "summary": "Gives a job to the pool, and its job id."
    },
    {
     "synopsis": "tpool::wait POOL JOBLIST ?VAR?",
     "summary": "Waits for one job of the list to end, and gives the ids of the jobs that ended."
    },
    {
     "synopsis": "tpool::get POOL JOB",
     "summary": "The result of a job that ended."
    },
    {
     "synopsis": "tpool::cancel POOL JOBLIST ?VAR?",
     "summary": "Removes jobs that have not started."
    },
    {
     "synopsis": "tpool::suspend POOL",
     "summary": "Stops the start of new jobs. `tpool::resume` starts them again."
    },
    {
     "synopsis": "tpool::preserve POOL",
     "summary": "Adds a reference. `tpool::release` removes one."
    },
    {
     "synopsis": "tpool::names",
     "summary": "The ids of the pools."
    }
   ],
   "options": [],
   "capability": "thread",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/tpool/"
  },
  {
   "name": "info",
   "area": "system",
   "synopsis": [
    "info subcommand ?arg ...?"
   ],
   "summary": "Facts about the interpreter: its commands, procs, variables, and the call stack.",
   "names": [
    "info"
   ],
   "subcommands": [
    {
     "synopsis": "info commands ?PATTERN?",
     "summary": "The names of the commands."
    },
    {
     "synopsis": "info procs ?PATTERN?",
     "summary": "The names of the procs."
    },
    {
     "synopsis": "info exists VAR",
     "summary": "1 when the variable has a value."
    },
    {
     "synopsis": "info vars ?PATTERN?",
     "summary": "The visible variables."
    },
    {
     "synopsis": "info globals ?PATTERN?",
     "summary": "The variables of the top level."
    },
    {
     "synopsis": "info locals ?PATTERN?",
     "summary": "The local variables of the proc."
    },
    {
     "synopsis": "info args PROC",
     "summary": "The argument names of a proc."
    },
    {
     "synopsis": "info body PROC",
     "summary": "The body of a proc."
    },
    {
     "synopsis": "info default PROC ARG VAR",
     "summary": "1 when the argument has a default, which goes in VAR."
    },
    {
     "synopsis": "info level ?N?",
     "summary": "The depth of the call stack, or the command at level N."
    },
    {
     "synopsis": "info complete SCRIPT",
     "summary": "1 when the script has no open brace, bracket, or quote."
    },
    {
     "synopsis": "info script ?NAME?",
     "summary": "The file of the script that `source` runs."
    },
    {
     "synopsis": "info functions ?PATTERN?",
     "summary": "The names of the math functions."
    },
    {
     "synopsis": "info cmdcount",
     "summary": "The count of commands that ran."
    },
    {
     "synopsis": "info patchlevel",
     "summary": "The version of Tcl that ztcl follows: 9.1.0, or 8.6.16 with `--tcl 8.6`."
    },
    {
     "synopsis": "info tclversion",
     "summary": "9.1, or 8.6 with `--tcl 8.6`."
    },
    {
     "synopsis": "info library",
     "summary": "The folder of the Tcl library: empty in ztcl."
    },
    {
     "synopsis": "info loaded",
     "summary": "The loaded binary packages."
    },
    {
     "synopsis": "info nameofexecutable",
     "summary": "The path of the program."
    },
    {
     "synopsis": "info sharedlibextension",
     "summary": "The extension of a shared library."
    },
    {
     "synopsis": "info hostname",
     "summary": "The name of the host."
    },
    {
     "synopsis": "info errorstack ?INTERP?",
     "summary": "The `-errorstack` of the last error: INNER and the failed command, then CALL and the words of each proc that the error left, and UP and a count of levels for a catch in the frame of `uplevel`."
    },
    {
     "synopsis": "info coroutine",
     "summary": "The full name of the running coroutine, or an empty string."
    },
    {
     "synopsis": "info class SUBCOMMAND CLASS ?arg ...?",
     "summary": "Facts about a TclOO class, as `info class` of Tcl 8.6."
    },
    {
     "synopsis": "info object SUBCOMMAND OBJECT ?arg ...?",
     "summary": "Facts about a TclOO object, as `info object` of Tcl 8.6."
    }
   ],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "proc f {a {b 2}} {}; info args f",
     "result": "a b"
    },
    {
     "command": "info complete \"set x \\{\"",
     "result": "0"
    },
    {
     "command": "info patchlevel",
     "result": "9.1.0"
    }
   ],
   "errors": [],
   "differences": [
    "`info frame` is not in ztcl in this version: it gives the error \"not supported by ztcl\". The first word pair of `info errorstack` is INNER and the text of the failed command, where Tcl has the words of its bytecode instruction."
   ],
   "page": "https://beetlebug.org/ztcl/reference/info/"
  },
  {
   "name": "clock",
   "area": "system",
   "synopsis": [
    "clock subcommand ?arg ...?"
   ],
   "summary": "The time. `clock seconds` gives the seconds since 1970-01-01 UTC. The time and the zone data come from the host.",
   "names": [
    "clock"
   ],
   "subcommands": [
    {
     "synopsis": "clock seconds",
     "summary": "The seconds since the epoch."
    },
    {
     "synopsis": "clock milliseconds",
     "summary": "The milliseconds since the epoch."
    },
    {
     "synopsis": "clock microseconds",
     "summary": "The microseconds since the epoch."
    },
    {
     "synopsis": "clock clicks ?-milliseconds|-microseconds?",
     "summary": "A counter for time spans."
    },
    {
     "synopsis": "clock format SECONDS ?-format FMT? ?-gmt BOOL? ?-timezone ZONE? ?-locale L?",
     "summary": "The time as text. `%Y-%m-%d %H:%M:%S` and the other fields of `strftime`."
    },
    {
     "synopsis": "clock scan TEXT ?-format FMT? ?-gmt BOOL? ?-timezone ZONE? ?-base SECONDS?",
     "summary": "The seconds of a time in text."
    },
    {
     "synopsis": "clock add SECONDS ?COUNT UNIT ...? ?-gmt BOOL? ?-timezone ZONE?",
     "summary": "The seconds after adding days, months, and other units."
    }
   ],
   "options": [],
   "capability": "clock",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "clock format 0 -format %Y-%m-%d -gmt 1",
     "result": "1970-01-01"
    },
    {
     "command": "clock scan 1970-01-02 -format %Y-%m-%d -gmt 1",
     "result": "86400"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/clock/"
  },
  {
   "name": "http",
   "area": "system",
   "synopsis": [
    "http::geturl url ?-option value ...?"
   ],
   "summary": "The http package 2.9.8 of the Tcl library, with `package require http`: an HTTP/1.1 client on the sockets of ztcl. `http::geturl` sends a GET, a POST with `-query` or `-querychannel`, or a HEAD with `-validate 1`, and gives a token, the name of an array with the status, the headers, and the body of the reply. With `-command` the request runs in the event loop and the command gets the token at the end. `http::config` sets the proxy, the user agent, and the other defaults, `http::formatQuery` encodes a query, and `http::status`, `http::ncode`, `http::meta`, `http::data`, and `http::cleanup` read and free a token. A request with `-keepalive 1` uses one persistent socket for each host and port. `https` URLs use the TLS channels of `ztcl::tls`. `package require http 1.0` gives the old commands `http_get`, `http_config`, and the others.",
   "names": [
    "http",
    "http::config",
    "http::geturl",
    "http::formatQuery",
    "http::quoteString",
    "http::reset",
    "http::wait",
    "http::status",
    "http::size",
    "http::code",
    "http::ncode",
    "http::meta",
    "http::data",
    "http::error",
    "http::cleanup",
    "http::register",
    "http::registerError",
    "http::unregister"
   ],
   "subcommands": [],
   "options": [],
   "capability": "package",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "package require http",
     "result": "2.9.8"
    },
    {
     "command": "http::formatQuery name \"a b\" x &",
     "result": "name=a%20b&x=%26"
    }
   ],
   "errors": [],
   "differences": [
    "The requests on one persistent socket go one after the other, so `-pipeline` does not change the order on the socket. The codings gzip, deflate, and compress need the `zlib` command, so the default Accept-Encoding is identity."
   ],
   "page": "https://beetlebug.org/ztcl/reference/http/"
  },
  {
   "name": "tcl::OptProc",
   "area": "system",
   "synopsis": [
    "tcl::OptProc name description body"
   ],
   "summary": "The opt package 0.4.9 of the Tcl library, with `package require opt`: a proc whose words are checked against a description of flags and parameters. Each item of the description is a flag (`-name`) or a parameter (`name`, or `?name?` when it is optional), with a type (`-int`, `-float`, `-boolean`, `-string`, `-list`, `-choice LIST`, `-any`), a default value, and a help text. A flag can be a prefix of its name in any case. The body sees a variable for each item. `-help` gives a table of the items, and a missing, bad, or extra word gives an error with that table.",
   "names": [
    "tcl::OptProc",
    "tcl::OptKeyRegister",
    "tcl::OptKeyDelete",
    "tcl::OptKeyParse",
    "tcl::OptKeyError",
    "tcl::OptParse",
    "tcl::OptProcArgGiven",
    "tcl::OptCheckType",
    "tcl::Lempty",
    "tcl::Lget",
    "tcl::Lvarset",
    "tcl::Lvarset1",
    "tcl::Lvarincr",
    "tcl::Lvarpop",
    "tcl::Lassign",
    "tcl::SetMax",
    "tcl::SetMin"
   ],
   "subcommands": [],
   "options": [],
   "capability": "package",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "package require opt",
     "result": "0.4.9"
    },
    {
     "command": "tcl::OptProc greet {{name -string \"who\"} {-loud}} {list $name $loud}; greet Ann -l",
     "result": "Ann 1"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/tcl-OptProc/"
  },
  {
   "name": "platform::generic",
   "area": "system",
   "synopsis": [
    "platform::generic",
    "platform::identify",
    "platform::patterns identifier"
   ],
   "summary": "The platform package 1.0.19 of the Tcl library, with `package require platform`: the system and the CPU as one identifier OS-CPU, such as `linux-x86_64` or `macosx-arm`, from `tcl_platform`. `identify` gives the same identifier as `generic`. `patterns` gives the identifiers that a package built for an identifier can run on, ending with `tcl`.",
   "names": [
    "platform::generic",
    "platform::identify",
    "platform::patterns"
   ],
   "subcommands": [],
   "options": [],
   "capability": "package",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "package require platform",
     "result": "1.0.19"
    },
    {
     "command": "lindex [platform::patterns [platform::identify]] end",
     "result": "tcl"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/platform-generic/"
  },
  {
   "name": "msgcat",
   "area": "system",
   "synopsis": [
    "msgcat::mc src ?arg ...?"
   ],
   "summary": "Message catalogs for text in more than one language, as the msgcat package 1.6.1 of Tcl. Each namespace is a package with its own messages and options. `mcset` adds a translation for a locale, `mclocale` sets the locale, and `mc` gives the text for the current locale and the namespace of the caller or one of its parents, with `format` on the arguments, or calls `mcunknown`. `mcload` sources the `.msg` file of each loaded locale of a folder, `mcpreferences` gives the locale and its parents, `mcexists` tests for a translation, and `mcmax` gives the longest translation. `mcpackagelocale` gives a namespace its own locale, `mcpackageconfig` sets its folder and its callbacks, `mcloadedlocales` lists or clears the loaded locales, and `mcforgetpackage` removes the data of a namespace.",
   "names": [
    "msgcat",
    "msgcat::mc",
    "msgcat::mclocale",
    "msgcat::mcmset",
    "msgcat::mcset",
    "msgcat::mcexists",
    "msgcat::mcload",
    "msgcat::mcmax",
    "msgcat::mcpreferences",
    "msgcat::mcflset",
    "msgcat::mcflmset",
    "msgcat::mcunknown",
    "msgcat::mcloadedlocales",
    "msgcat::mcpackagelocale",
    "msgcat::mcpackageconfig",
    "msgcat::mcforgetpackage"
   ],
   "subcommands": [],
   "options": [],
   "capability": "clock",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "msgcat::mclocale fr; msgcat::mcset fr Hello Bonjour; msgcat::mc Hello",
     "result": "Bonjour"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/msgcat/"
  },
  {
   "name": "exec",
   "area": "system",
   "synopsis": [
    "exec ?-option ...? arg ?arg ...?"
   ],
   "summary": "Runs a program and gives its output. `|` makes a pipeline, `<` and `>` redirect, and `&` runs it in the background. A process of `exec` is outside the root folder and each limit, with the full power of the user. Turn it on only for scripts that you trust.",
   "names": [
    "exec"
   ],
   "subcommands": [],
   "options": [
    {
     "option": "-ignorestderr",
     "summary": "Output on the error stream is not an error."
    },
    {
     "option": "-keepnewline",
     "summary": "Keeps the last newline of the output."
    },
    {
     "option": "-vm VM",
     "summary": "Runs the pipeline in the running guest VM of `ztcl::vm`, through its agent, and needs the `vm` capability. Each program of the pipeline runs in that one guest, and a bare name goes through the `PATH` of the guest. A redirection to a file opens the file on the host under the file policy of the interpreter, and the host copies the bytes. With no file capability, a redirection to a file is an error. `&` gives the process ids of the guest."
    },
    {
     "option": "-isolation LEVEL",
     "summary": "`none` (the default) runs host programs. `vm` runs the pipeline in a new guest of `ztcl::vm` for this call only, as `-vm` does, and deletes the guest after it. The options `-image`, `-snapshot`, `-memory`, `-cpus`, `-net`, `-share`, `-kernel`, `-initrd`, and `-cmdline` go to `ztcl::vm create`. With no `-image`, `-snapshot`, or `-kernel`, the guest is of the image `ztcl-guest`. A guest of an image comes from the pool of booted guests when the embedder has one. It needs the `vm` capability."
    },
    {
     "option": "--",
     "summary": "Ends the options."
    }
   ],
   "capability": "exec",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/exec/"
  },
  {
   "name": "pid",
   "area": "system",
   "synopsis": [
    "pid ?fileId?"
   ],
   "summary": "The process id of the program, or of the processes of a pipeline.",
   "names": [
    "pid"
   ],
   "subcommands": [],
   "options": [],
   "capability": "exec",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/pid/"
  },
  {
   "name": "exit",
   "area": "system",
   "synopsis": [
    "exit ?returnCode?"
   ],
   "summary": "Ends the program with the code (0 by default). In an embedded interpreter, the host gets the code.",
   "names": [
    "exit"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/exit/"
  },
  {
   "name": "ztcl::json",
   "area": "ztcl",
   "synopsis": [
    "ztcl::json subcommand ?arg ...?"
   ],
   "summary": "JSON: parse to Tcl values, read one value with no full parse, check, and write with a schema. An object is a dict, and an array is a list. Load it with `package require ztcl::json`.",
   "names": [
    "ztcl::json",
    "ztcl::json::parse",
    "ztcl::json::valid",
    "ztcl::json::get",
    "ztcl::json::exists",
    "ztcl::json::encode",
    "ztcl::json::object",
    "ztcl::json::array",
    "ztcl::json::string",
    "ztcl::json::number",
    "ztcl::json::bool",
    "ztcl::json::null",
    "ztcl::json::raw",
    "ztcl::json::pretty"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "package require ztcl::json; ztcl::json parse {{\"a\": [1, 2]}}",
     "result": "a {1 2}"
    },
    {
     "command": "ztcl::json encode -schema {object {n int}} {n 5}",
     "result": "{\"n\":5}"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/ztcl-json/"
  },
  {
   "name": "ztcl::vt",
   "area": "ztcl",
   "synopsis": [
    "ztcl::vt subcommand ?arg ...?"
   ],
   "summary": "A terminal screen in memory: feed it the bytes of a program, and read its cells and its text.",
   "names": [
    "ztcl::vt"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/ztcl-vt/"
  },
  {
   "name": "ztcl::wasm",
   "area": "ztcl",
   "synopsis": [
    "ztcl::wasm subcommand ?arg ...?"
   ],
   "summary": "Runs WebAssembly modules in the sandbox and the limits of the interpreter: decodes and validates a module, links its imports to Tcl commands, other instances, or WASI preview 1, and calls its exports with Tcl values. Load it with `package require ztcl::wasm`.",
   "names": [
    "ztcl::wasm"
   ],
   "subcommands": [
    {
     "synopsis": "load fileName",
     "summary": "Reads, decodes, and validates a module file, and gives a module handle. Needs the capability `file`."
    },
    {
     "synopsis": "new bytes",
     "summary": "Decodes and validates the bytes of a module, and gives a module handle."
    },
    {
     "synopsis": "instantiate module ?option value ...?",
     "summary": "Links the imports (`-imports`, `-link`, `-wasi`), runs the start function, and gives an instance handle."
    },
    {
     "synopsis": "call instance function ?-limit units? ?-raw? ?--? ?arg ...?",
     "summary": "Calls an export and gives its result, a list of its results, or an empty string."
    },
    {
     "synopsis": "package fileName ?prefix? ?-wasi dict?",
     "summary": "Loads a Tcl C package built for `wasm32-wasi` with `libztclstubs.a` and runs its init function. Needs the capability `file`."
    },
    {
     "synopsis": "run module|fileName ?option value ...?",
     "summary": "Runs a WASI command (`_start`) and gives its exit code."
    },
    {
     "synopsis": "memory instance size|grow|read|write|string ?arg ...?",
     "summary": "Reads, writes, and grows the linear memory of an instance."
    },
    {
     "synopsis": "global instance name ?value?",
     "summary": "Reads or sets an exported global."
    },
    {
     "synopsis": "exports module|instance",
     "summary": "A list of name, kind, and type for each export."
    },
    {
     "synopsis": "imports module",
     "summary": "A list of module, name, kind, and type for each import."
    },
    {
     "synopsis": "info module",
     "summary": "A dict of the counts and the features of a module."
    },
    {
     "synopsis": "delete handle ?handle ...?",
     "summary": "Deletes modules and instances."
    },
    {
     "synopsis": "jit ?boolean?",
     "summary": "Reads or sets the use of the JIT tier for the calls of the interpreter. Gives 1 when the JIT is on. The JIT is on by default on x86-64 Linux and macOS, and the interpreter runs elsewhere."
    }
   ],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "one compute unit for each call and each loop pass of the wasm code",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/ztcl-wasm/"
  },
  {
   "name": "ztcl::text",
   "area": "ztcl",
   "synopsis": [
    "ztcl::text subcommand ?arg ...?"
   ],
   "summary": "Cuts a string into grapheme clusters, words, or sentences by the rules of Unicode 18.0.0 (UAX #29), and gives its display width in columns (UAX #11 and UTS #51). Load it with `package require ztcl::text`.",
   "names": [
    "ztcl::text",
    "ztcl::text::graphemes",
    "ztcl::text::words",
    "ztcl::text::sentences",
    "ztcl::text::width",
    "ztcl::text::bounds"
   ],
   "subcommands": [
    {
     "synopsis": "graphemes STRING",
     "summary": "The list of the grapheme clusters: the characters that a user sees, such as an emoji with a skin tone or a letter with accents."
    },
    {
     "synopsis": "words ?-all? STRING",
     "summary": "The list of the word segments that have a letter or a number. With `-all`, each segment, so `join` of the list gives the string again."
    },
    {
     "synopsis": "sentences STRING",
     "summary": "The list of the sentences, each with its spaces and line end."
    },
    {
     "synopsis": "width ?-ambiguous narrow|wide? STRING",
     "summary": "The count of columns of the string in a terminal or a monospace font. The East Asian Ambiguous characters are 1 column, or 2 with `-ambiguous wide`."
    },
    {
     "synopsis": "bounds ?-unit grapheme|word|sentence? STRING",
     "summary": "The list of the character index of each boundary, from 0 to the length of the string."
    }
   ],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "One compute unit for each 4,096 bytes of the string.",
   "examples": [
    {
     "command": "package require ztcl::text",
     "result": null
    },
    {
     "command": "llength [ztcl::text graphemes \"e\\u0301\\U1F44D\\U1F3FD\"]",
     "result": "2"
    },
    {
     "command": "ztcl::text words \"Hello, world.\"",
     "result": "Hello world"
    },
    {
     "command": "ztcl::text width \"\\u4E2D\\u6587 ok\"",
     "result": "7"
    },
    {
     "command": "ztcl::text bounds \"ab\\u0301c\"",
     "result": "0 1 3 4"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/ztcl-text/"
  },
  {
   "name": "ztcl::probe",
   "area": "ztcl",
   "synopsis": [
    "ztcl::probe subcommand ?arg ...?"
   ],
   "summary": "Records the values of a running script at a proc, a line, a command, a variable, or an error, with no change to the script, and gives the records back as dicts or JSON.",
   "names": [
    "ztcl::probe"
   ],
   "subcommands": [],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/ztcl-probe/"
  },
  {
   "name": "ztcl::tls",
   "area": "ztcl",
   "synopsis": [
    "ztcl::tls socket ?-servername name? ?-alpn protocols? ?-cadata pem? ?-verify boolean? host port"
   ],
   "summary": "A TLS 1.3 client: connects to `host` on `port`, runs the handshake, checks the certificate chain and the host name, and gives a channel. Load it with `package require ztcl::tls`.",
   "names": [
    "ztcl::tls",
    "ztcl::tls::socket"
   ],
   "subcommands": [
    {
     "synopsis": "socket ?option value ...? host port",
     "summary": "Opens the connection and gives the name of the channel. A failed handshake closes the connection and gives an error."
    }
   ],
   "options": [
    {
     "option": "-servername name",
     "summary": "The DNS name for SNI and for the check of the certificate. The default is `host`."
    },
    {
     "option": "-alpn protocols",
     "summary": "A list of up to 8 ALPN protocols."
    },
    {
     "option": "-cadata pem",
     "summary": "The trust anchors as PEM text, in place of the store of the system."
    },
    {
     "option": "-verify boolean",
     "summary": "With 0, the chain and the host name are not checked. The default is 1."
    }
   ],
   "capability": "socket",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/ztcl-tls/"
  },
  {
   "name": "ztcl::pty",
   "area": "ztcl",
   "synopsis": [
    "ztcl::pty subcommand ?arg ...?"
   ],
   "summary": "Runs a program in a pseudo terminal, for `ztcl::vt` and for tests of terminal apps.",
   "names": [
    "ztcl::pty"
   ],
   "subcommands": [],
   "options": [],
   "capability": "exec",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/ztcl-pty/"
  },
  {
   "name": "ztcl::watch",
   "area": "ztcl",
   "synopsis": [
    "ztcl::watch subcommand ?arg ...?"
   ],
   "summary": "Runs a script when a file or a folder changes.",
   "names": [
    "ztcl::watch"
   ],
   "subcommands": [],
   "options": [],
   "capability": "file",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/ztcl-watch/"
  },
  {
   "name": "ztcl::open",
   "area": "ztcl",
   "synopsis": [
    "ztcl::open target"
   ],
   "summary": "Opens a URL or a file in the default app of the host.",
   "names": [
    "ztcl::open"
   ],
   "subcommands": [],
   "options": [],
   "capability": "launch",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/ztcl-open/"
  },
  {
   "name": "ztcl::notify",
   "area": "ztcl",
   "synopsis": [
    "ztcl::notify ?-option value ...? title ?body?"
   ],
   "summary": "Shows a notification of the system.",
   "names": [
    "ztcl::notify"
   ],
   "subcommands": [],
   "options": [],
   "capability": "notify",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/ztcl-notify/"
  },
  {
   "name": "ztcl::gc",
   "area": "ztcl",
   "synopsis": [
    "ztcl::gc subcommand"
   ],
   "summary": "Gives the counts of the collector of the heap of the interpreter tree: the pauses, the time of the marks and the sweeps, the bytes of the heap, the bytes that the program allocated, and the resident set of the process. The counts of time depend on the host.",
   "names": [
    "ztcl::gc"
   ],
   "subcommands": [
    {
     "synopsis": "ztcl::gc stats",
     "summary": "A dict of the counts: `collections`, `gc_ns`, `mark_ns`, `sweep_ns`, `pause_p50_ns`, `pause_p99_ns`, `pause_max_ns`, `heap_bytes`, `heap_peak`, `live_bytes`, `used_bytes`, `threshold`, `allocated`, `freed`, `alloc_rate`, `uptime_ns`, `rss`, `rss_peak`, `returned`, and `retained`."
    },
    {
     "synopsis": "ztcl::gc collect",
     "summary": "Runs a collection now, where the build can collect."
    },
    {
     "synopsis": "ztcl::gc reset",
     "summary": "Starts the counts again."
    }
   ],
   "options": [],
   "capability": "meter",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "ztcl::gc reset",
     "result": null
    },
    {
     "command": "dict get [ztcl::gc stats] collections",
     "result": "0"
    },
    {
     "command": "dict size [ztcl::gc stats]",
     "result": "20"
    }
   ],
   "errors": [
    {
     "command": "ztcl::gc nope",
     "message": "bad option \"nope\": must be collect, reset, or stats"
    }
   ],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/ztcl-gc/"
  },
  {
   "name": "ztcl::meter",
   "area": "ztcl",
   "synopsis": [
    "ztcl::meter subcommand ?arg ...?"
   ],
   "summary": "Counts the compute units, the time, the memory, and the I/O of threads and child interpreters, for a host that bills its customers. A compute unit is the same on each machine and with the JIT on or off. A record is a line of JSON in a hash chain, with an optional Ed25519 signature.",
   "names": [
    "ztcl::meter"
   ],
   "subcommands": [
    {
     "synopsis": "ztcl::meter create NAME ?-budget UNITS? ?-tenant TEXT?",
     "summary": "Makes the meter NAME, or sets the options of the meter NAME. A budget caps the compute units of all the threads of the meter."
    },
    {
     "synopsis": "ztcl::meter get NAME",
     "summary": "The dict of the counts of NAME."
    },
    {
     "synopsis": "ztcl::meter list",
     "summary": "The names of the meters."
    },
    {
     "synopsis": "ztcl::meter reset NAME",
     "summary": "Sets each count of NAME to zero."
    },
    {
     "synopsis": "ztcl::meter delete NAME",
     "summary": "Removes NAME. A thread that counts in it goes on to count in it until it ends."
    },
    {
     "synopsis": "ztcl::meter run NAME SCRIPT",
     "summary": "Runs SCRIPT in the current interpreter and counts it in NAME. The budget of NAME caps the units of SCRIPT."
    },
    {
     "synopsis": "ztcl::meter record NAME ?-tenant TEXT? ?-script TEXT? ?-sign? ?-key SEED?",
     "summary": "The usage record of NAME: one line of JSON with the SHA-256 of the record before it. `-key` signs with the Ed25519 key of a 64-digit hex seed, and `-sign` with the key of the host."
    },
    {
     "synopsis": "ztcl::meter verify RECORD PUBLICKEY",
     "summary": "1 when the signature of RECORD matches the hex public key, else 0."
    },
    {
     "synopsis": "ztcl::meter pubkey SEED",
     "summary": "The hex public key of a hex seed."
    }
   ],
   "options": [],
   "capability": "meter",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "ztcl::meter create demo -tenant acme",
     "result": "demo"
    },
    {
     "command": "ztcl::meter run demo {set a 1; set b 2}; dict get [ztcl::meter get demo] units",
     "result": "2"
    },
    {
     "command": "ztcl::meter create small -budget 100",
     "result": "small"
    },
    {
     "command": "catch {ztcl::meter run small {while 1 {}}} msg; set msg",
     "result": "compute limit reached"
    }
   ],
   "errors": [
    {
     "command": "ztcl::meter get nope",
     "message": "no meter \"nope\""
    }
   ],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/ztcl-meter/"
  },
  {
   "name": "ztcl::agent",
   "area": "ztcl",
   "synopsis": [
    "ztcl::agent subcommand ?arg ...?"
   ],
   "summary": "Runs an LLM agent loop in an isolated thread with no capability, which holds only the data and the tools that the host gives it. The host posts each request to its one endpoint with its own headers, runs only its own tools, and checks the result against a schema. Load it with `package require ztcl::agent`.",
   "names": [
    "ztcl::agent"
   ],
   "subcommands": [
    {
     "synopsis": "ztcl::agent run ?-option value ...?",
     "summary": "Runs the loop. Gives a dict of the result, the log, and the counts."
    },
    {
     "synopsis": "ztcl::agent doc NAME TEXT ?ARG TYPE ...?",
     "summary": "Sets the text of the tool NAME and the types of its arguments."
    },
    {
     "synopsis": "ztcl::agent describe NAME",
     "summary": "The spec of the command NAME as a tool: name, text, JSON schema, and parameters."
    },
    {
     "synopsis": "ztcl::agent check SCHEMA VALUE",
     "summary": "VALUE when it matches the result schema SCHEMA, else the error `ZTCL AGENT RESULT`."
    },
    {
     "synopsis": "ztcl::agent schema SCHEMA",
     "summary": "The JSON schema of a result schema."
    },
    {
     "synopsis": "ztcl::agent post URL HEADERS BODY",
     "summary": "One HTTP/1.1 POST of a JSON body. Gives `status N body TEXT`."
    }
   ],
   "options": [],
   "capability": "thread",
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "package require ztcl::agent; ztcl::agent check {n int tags {list string}} {n 3 tags {a b}}",
     "result": "n 3 tags {a b}"
    },
    {
     "command": "catch {ztcl::agent check {kind {enum a b}} {kind c}} msg; set msg",
     "result": "result.kind is not enum a b"
    },
    {
     "command": "proc greet {name {times 1}} {}; lindex [ztcl::agent describe greet] 3",
     "result": "{name required} {times optional}"
    },
    {
     "command": "ztcl::agent schema {n int}",
     "result": "{\"type\":\"object\",\"properties\":{\"n\":{\"type\":\"integer\"}},\"required\":[\"n\"],\"additionalProperties\":false}"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/ztcl-agent/"
  },
  {
   "name": "ztcl::pdf",
   "area": "ztcl",
   "synopsis": [
    "ztcl::pdf subcommand ?arg ...?"
   ],
   "summary": "Makes a PDF document: pages, text in embedded TrueType fonts, rectangles, lines, images, links, named places, the outline, and the document information.",
   "names": [
    "ztcl::pdf"
   ],
   "subcommands": [
    {
     "synopsis": "create ?-compress bool?",
     "summary": "Makes a document and gives its handle."
    },
    {
     "synopsis": "font doc bytes",
     "summary": "Adds a TrueType font and gives its number."
    },
    {
     "synopsis": "page doc ?width height?",
     "summary": "Adds a page and gives its number. The default is A4."
    },
    {
     "synopsis": "text doc page font size x y string ?-color rgb? ?-ligatures bool?",
     "summary": "Shows text and gives its width."
    },
    {
     "synopsis": "measure doc font size string",
     "summary": "Gives the width of a string in points."
    },
    {
     "synopsis": "rect doc page x y width height ?-fill rgb?",
     "summary": "Fills a rectangle."
    },
    {
     "synopsis": "line doc page x0 y0 x1 y1 ?-width w? ?-color rgb?",
     "summary": "Strokes a line."
    },
    {
     "synopsis": "image doc bytes",
     "summary": "Adds a PNG or JPEG image and gives {number width height}."
    },
    {
     "synopsis": "place doc page image x y width height",
     "summary": "Shows an image in a rectangle."
    },
    {
     "synopsis": "link doc page x0 y0 x1 y1 -uri url|-dest name",
     "summary": "Makes a rectangle a link."
    },
    {
     "synopsis": "dest doc name page x y",
     "summary": "Names a place for a link."
    },
    {
     "synopsis": "outline doc title level page y",
     "summary": "Adds an entry to the outline."
    },
    {
     "synopsis": "info doc key value",
     "summary": "Sets the Title, Author, Subject, or Keywords."
    },
    {
     "synopsis": "bytes doc",
     "summary": "Gives the bytes of the PDF file."
    },
    {
     "synopsis": "pages doc",
     "summary": "Gives the count of pages."
    },
    {
     "synopsis": "delete doc",
     "summary": "Frees the document."
    }
   ],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/ztcl-pdf/"
  },
  {
   "name": "ztcl::typeset",
   "area": "ztcl",
   "synopsis": [
    "ztcl::typeset subcommand ?arg ...?"
   ],
   "summary": "Breaks paragraphs into lines with the total-fit algorithm of Knuth and Plass, hyphenates words with the patterns of Liang, measures text in TrueType fonts, and lays out Markdown into the pages of a PDF document.",
   "names": [
    "ztcl::typeset"
   ],
   "subcommands": [
    {
     "synopsis": "break text -width w ?options?",
     "summary": "Gives the lines of a paragraph, with the x position of each word."
    },
    {
     "synopsis": "justify text -width columns ?options?",
     "summary": "Gives justified lines of characters, for a terminal."
    },
    {
     "synopsis": "svg text -width w -font font ?options?",
     "summary": "Gives an SVG image of a paragraph."
    },
    {
     "synopsis": "hyphenate word ?-lang en-us?",
     "summary": "Gives the word with a hyphen at each place where it can break."
    },
    {
     "synopsis": "pages counts -lines n ?-columns c? ?-gap g?",
     "summary": "Places paragraphs in columns and pages with no widow or orphan line."
    },
    {
     "synopsis": "font load bytes",
     "summary": "Loads a TrueType font and gives its handle."
    },
    {
     "synopsis": "font metrics font size",
     "summary": "Gives the metrics of a font at a size."
    },
    {
     "synopsis": "font measure font size string",
     "summary": "Gives the width of a string in points."
    },
    {
     "synopsis": "markdown doc text -fonts dict ?-style dict? ?-run prefix?",
     "summary": "Lays out Markdown into new pages of a document."
    },
    {
     "synopsis": "book doc chapters -fonts dict ?-style dict? ?-run prefix?",
     "summary": "Lays out a list of Markdown chapters into new pages of a document."
    }
   ],
   "options": [],
   "capability": null,
   "tcl": null,
   "compute": "1 for the call",
   "examples": [
    {
     "command": "package require ztcl::typeset; ztcl::typeset hyphenate typesetting",
     "result": "type-set-ting"
    }
   ],
   "errors": [],
   "differences": [],
   "page": "https://beetlebug.org/ztcl/reference/ztcl-typeset/"
  }
 ]
}