From a77ef1a6218fad4c928ddbdc03c1aedc41007e70 Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Sun, 28 Nov 2021 09:06:54 +1000 Subject: Generate shipped documentation for 0.81 Signed-off-by: Steve Bennett --- Tcl_shipped.html | 384 ++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 353 insertions(+), 31 deletions(-) (limited to 'Tcl_shipped.html') diff --git a/Tcl_shipped.html b/Tcl_shipped.html index 0159e49..acee1e8 100644 --- a/Tcl_shipped.html +++ b/Tcl_shipped.html @@ -739,7 +739,7 @@ Jim Tcl(n) Manual Page

NAME

-

Jim Tcl v0.80 - +

Jim Tcl v0.81 - reference manual for the Jim Tcl scripting language

@@ -880,6 +880,67 @@ Support for UDP, IPv6, Unix-Domain sockets in addition to TCP sockets

RECENT CHANGES

+

Changes between 0.80 and 0.81

+
    +
  1. +

    +TIP 582, comments allowed in expressions +

    +
  2. +
  3. +

    +Many commands now accept "safe" integer expressions rather than simple integers: + loop, range, incr, string repeat, lrepeat, pack, unpack, rand +

    +
  4. +
  5. +

    +String and list indexes now accept integer expressions (STRING AND LIST INDEX SPECIFICATIONS) +

    +
  6. +
  7. +

    +loop can now omit the start value +

    +
  8. +
  9. +

    +Add the xtrace command for execution trace support +

    +
  10. +
  11. +

    +Add history keep +

    +
  12. +
  13. +

    +Add support for lsearch -index and lsearch -stride, the latter per TIP 351 +

    +
  14. +
  15. +

    +lsort -index now supports multiple indices +

    +
  16. +
  17. +

    +Add support for lsort -stride +

    +
  18. +
  19. +

    +open now supports POSIX-style access arguments +

    +
  20. +
  21. +

    +TIP 526, expr now only allows a single argument (unless --compat is enabled) +

    +
  22. +
+
+

Changes between 0.79 and 0.80

  1. @@ -1753,25 +1814,40 @@ specify a position in the string relative to the start or end of the string/list

    - A simple integer, where 0 refers to the first element of the string + A simple integer, where 0 refers to the first element of the string or list.

    -integer+integer or +integerexpression +
    +
    +

    + Any "safe" expression that evaluates to an integer. A "safe" expression does not perform + variable or command subsitution, but is otherwise like a normal expression + (see EXPRESSIONS). +

    +
    +
    +
    +
    +

    + For example 1+2*3 is valid integer expression, but {$x*2-1} is not. + But note that it is possible to use an unbraced expression to allow the Tcl interpreter + to expand variables and commands before being parsed as an integer expression. +

    +
    -integer-integer +

    - The sum or difference of the two integers. e.g. 2+3 refers to the 5th element. - This is useful when used with (e.g.) $i+1 rather than the more verbose - [expr {$i+1}] + e.g. string repeat a $x*2-1

    -end +end

    @@ -1779,11 +1855,20 @@ specify a position in the string relative to the start or end of the string/list

    -end-integer +end-integer +
    +
    +end-integerexpression +
    +
    +end+integerexpression

    - The nth-from-last element of the string or list. + The nth-from-last element of the string or list. Again, a "safe" integer expression + may be used in place of a simple integer. end-3 or end-3+2*$n. Normally it only makes + sense to use the end- form, but if the integer expression is negative, the end+ form + may be used.

@@ -1882,6 +1967,8 @@ and parentheses.

White space may be used between the operands and operators and parentheses; it is ignored by the expression processor. Where possible, operands are interpreted as integer values.

+

Comments are allowed in expressions, beginning with the # character +and continuing until the end of line or end of expression.

Integer values are interpreted as decimal, binary, octal or hexadecimal if prepended with 0d, 0b, 0o or 0x respectively. Otherwise they are interpreted as decimal by default. @@ -2411,6 +2498,11 @@ Support for non-capturing parentheses (?:…) Jim Tcl considers that both patterns and strings end at a null character (\x00)

+
  • +

    +Jim Tcl does not support back references. e.g. \1 +

    +
  • @@ -3293,8 +3385,8 @@ cellspacing="0" cellpadding="4">

    vwait

    wait

    while

    +

    xtrace

    zlib

    -

    @@ -4563,7 +4655,7 @@ and there was no bodyN.

    Increment the value stored in the variable whose name is varName. The value of the variable must be integral.

    If increment is supplied then its value (which must be an -integer) is added to the value of variable varName; otherwise +integer expression) is added to the value of variable varName; otherwise 1 is added to varName.

    The new value is stored as a decimal string in variable varName and also returned as result.

    @@ -4961,7 +5053,7 @@ than waiting until garbage collection.

    loop

    -

    loop var first limit ?incr? body

    +

    loop var ?first? limit ?incr? body

    Similar to for except simpler and possibly more efficient. If incr is positive, the effect is, equivalent to:

    @@ -4969,9 +5061,11 @@ If incr is positive, the effect is, equivalent to:

    for {set var $first} {$var < $limit} {incr var $incr} $body

    While if incr is negative, the count is downwards.

    -

    If incr is not specified, 1 is used. +

    If first is not specified, 0 is used. +If incr is not specified, 1 is used. Note that setting the loop variable inside the loop does not affect the loop count.

    +

    first, limit and incr may be any integer expression.

    lindex

    @@ -5255,29 +5349,149 @@ the list are to be matched against pattern and must have one of the values below Causes comparisons to be handled in a case-insensitive manner.

    +
    +-index indexList +
    +
    +

    + This option is designed for use when searching within nested lists. The + indexList gives a path of indices (much as might be used with + the lindex or lset commands) within each element to allow the location + of the term being matched against. +

    +
    +
    +-stride strideLength +
    +
    +

    + If this option is specified, the list is treated as consisting of + groups of strideLength elements and the groups are searched by + either their first element or, if the -index option is used, + by the element within each group given by the first index passed to + -index (which is then ignored by -index). The resulting + index always points to the first element in a group. +

    +
    +
    + +
    +
    +

    + The list length must be an integer multiple of strideLength, which + in turn must be at least 1. A strideLength of 1 is the default and + indicates no grouping. +

    +

    lsort

    -

    lsort ?-index listindex? ?-nocase|-integer|-real|-command cmdname? ?-unique? ?-decreasing|-increasing? list

    +

    lsort ?options? list

    Sort the elements of list, returning a new list in sorted order. By default, ASCII (or UTF-8) sorting is used, with the result in increasing order.

    -

    If -nocase is specified, comparisons are case-insensitive.

    -

    If -integer is specified, numeric sorting is used.

    -

    If -real is specified, floating point number sorting is used.

    -

    If -command cmdname is specified, cmdname is treated as a command -name. For each comparison, cmdname $value1 $value2 is called which -should compare the values and return an integer less than, equal -to, or greater than zero if the $value1 is to be considered less -than, equal to, or greater than $value2, respectively.

    -

    If -decreasing is specified, the resulting list is in the opposite -order to what it would be otherwise. -increasing is the default.

    -

    If -unique is specified, then only the last set of duplicate elements found in the list will be retained. -Note that duplicates are determined relative to the comparison used in the sort. Thus if -index 0 is used, -{1 a} and {1 b} would be considered duplicates and only the second element, {1 b}, would be retained.

    -

    If -index listindex is specified, each element of the list is treated as a list and -the given index is extracted from the list for comparison. The list index may -be any valid list index, such as 1, end or end-2.

    +

    Note that only one sort type may be selected with -integer, -real, -nocase or -command +with last option being used.

    +
    +
    +-integer +
    +
    +

    + Sort using numeric (integer) comparison. +

    +
    +
    +-real +
    +
    +

    + Sort using floating point comparison. +

    +
    +
    +-nocase +
    +
    +

    + Sort using using string comparison without regard for case. +

    +
    +
    +-command cmdname +
    +
    +

    + cmdname is treated as a command name. For each comparison, + cmdname $value1 $value2 is called which + should compare the values and return an integer less than, equal + to, or greater than zero if the $value1 is to be considered less + than, equal to, or greater than $value2, respectively. +

    +
    +
    +-increasing +
    +
    +

    + The resulting list is in ascending order, from smallest/lowest to largest/highest. + This is the default and does not need to be specified. +

    +
    +
    +-decreasing +
    +
    +

    + The resulting list is in the opposite order to what it would be otherwise. +

    +
    +
    +-unique +
    +
    +

    + Only the last set of duplicate elements found in the list will + be retained. Note that duplicates are determined relative to the + comparison used in the sort. Thus if -index 0 is used, {1 a} and + {1 b} would be considered duplicates and only the second element, + {1 b}, would be retained. +

    +
    +
    +-index indexList +
    +
    +

    + This option is designed for use when sorting nested lists. The + indexList gives a path of indices (much as might be used with + the lindex or lset commands) within each element to specify the + value to be used for comparison. +

    +
    +
    +-stride strideLength +
    +
    +

    + If this option is specified, the list is treated as consisting of + groups of strideLength elements and the groups are sorted by + either their first element or, if the -index option is used, + by the element within each group given by the first index passed to + -index (which is then ignored by -index). The resulting list + is once again a flat list. +

    +
    +
    + +
    +
    +

    + The list length must be an integer multiple of strideLength, which + in turn must be at least 2. +

    +
    +

    defer

    @@ -5361,6 +5575,87 @@ It may have any of the following values:

    access defaults to r.

    +

    Additionally, if POSIX mode is supported by the underlying system, +then access may insted of consistent of a list of any of the following +flags, all of which have the standard POSIX meanings. In this case, +the first flag must be one of RDONLY, WRONLY or RDWR.

    +
    +
    +RDONLY +
    +
    +

    + Open the file for reading only. +

    +
    +
    +WRONLY +
    +
    +

    + Open the file for writing only. +

    +
    +
    +RDWR +
    +
    +

    + Open the file for both reading and writing. +

    +
    +
    +APPEND +
    +
    +

    + Set the file pointer to the end of the file prior to each write. +

    +
    +
    +BINARY +
    +
    +

    + Ignored. +

    +
    +
    +CREAT +
    +
    +

    + Create the file if it does not already exist (without this flag + it is an error for the file not to exist). +

    +
    +
    +EXCL +
    +
    +

    + If CREAT is also specified, an error is returned if the file + already exists. +

    +
    +
    +NOCTTY +
    +
    +

    + If the file is a terminal device, this flag prevents the file + from becoming the controlling terminal of the process. +

    +
    +
    +TRUNC +
    +
    +

    + If the file exists it is truncated to zero length. +

    +
    +

    If a file is opened for both reading and writing, then seek must be invoked between a read and a write, or vice versa.

    If the first character of fileName is "|" then the remaining @@ -5486,6 +5781,7 @@ and ranging up to but not including end in steps of . range 7 4 -2 7 5

    +

    Integer parameters may be any integer expression.

    read

    @@ -6884,6 +7180,24 @@ commands may be executed inside body to cause immediate termination of the while command.

    The while command always returns an empty string.

    +
    +

    xtrace

    +

    xtrace command

    +

    Install an execution trace callback command. This is useful for implementing a debugger +or tracing tool. On each command invocation, the given command is invoked as:

    +
    +
    +
        command proc|cmd filename line result command arglist
    +
    +

    proc or cmd indicates whether a command or a proc body is being executed. +filename and line indicate the location where the command was invoked. +result is the current interpreter result (from the previous command). +command and arglist indicate the command being executed.

    +

    While the callback is executing, any further execution traces are temporarily disabled. +If the callback returns JIM_OK or JIM_RETURN, the execution trace is reinstalled. Otherwise +the execution trace is removed.

    +

    If xtrace is called with an empty argument (""), any existing callback is removed.

    +
    @@ -8013,6 +8327,14 @@ the remaining subcommands do nothing.

    +history keep ?count? +
    +
    +

    + Set or return the maximum history size. Defaults to 100. +

    +
    +
    history save filename
    -- cgit v1.1