aboutsummaryrefslogtreecommitdiff
path: root/jim_tcl.txt
AgeCommit message (Collapse)AuthorFilesLines
11 daysBump version to 0.83 for release0.83Steve Bennett1-1/+1
Update shipped docs Signed-off-by: Steve Bennett <steveb@workware.net.au>
11 daysdocument lsort -dict supportSteve Bennett1-4/+16
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2024-02-04aio: Add support for modem control signalsSteve Bennett1-1/+20
RTS, DTR, etc. and sending a break condition Signed-off-by: Steve Bennett <steveb@workware.net.au>
2024-02-04aio: tty: Add support for vstart and vstopSteve Bennett1-0/+6
xonxoff start and stop chars Signed-off-by: Steve Bennett <steveb@workware.net.au>
2024-02-03Fix typos. relating to 172b5c4prpr19xx1-3/+3
2024-02-02expr: better error message on nested $()Steve Bennett1-0/+17
And explain in the manual that it isn't allowed. Fixes: #285 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2024-01-29regexp: implement regsub -commandSteve Bennett1-1/+22
Per Tcl 8.7 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-08-27fix issues in the manualDaniele Parisi1-12/+12
2023-08-13jimsh, interp, tests: fixes when line editing is disabledSteve Bennett1-0/+4
- Set jim::lineedit to indicate if line editing is configured - Ensure that aio tty works even if line editing is disabled - Skip some tests if line editing is not configured Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-07-04core: add support for proc statics by referenceSteve Bennett1-0/+20
set a 5 proc b {} {&a} { incr a } b Now a is 6 because b captured a by reference instead of by value Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-07-04docs: Document tcl::stdhint, history hintsSteve Bennett1-0/+44
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-07-04docs: Add documentation for -noclose flagSteve Bennett1-27/+47
To open, socket and accept Also document aio getfd Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-07-04docs: document aio changesSteve Bennett1-179/+193
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-06-22docs: minor fix for currySteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-06-21docs: documentation updates for stacktrace changesSteve Bennett1-5/+10
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-05-25docs: document multi-level break, continueSteve Bennett1-5/+26
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13docs: document ensemble and namespace ensemble createSteve Bennett1-0/+23
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13docs: Add documentation for timerate commandSteve Bennett1-1/+25
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13vwait -signal docs and test scriptSteve Bennett1-2/+5
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13docs: update for new Tcl-compatible [info frame]Steve Bennett1-9/+21
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13Tcl-compatible 'info frame'Steve Bennett1-0/+2
Returns a dictionary with file, line, cmd, (possibly) proc and level. And support 'info frame 0' for the current command. Note that now all evaluation frames are captured, not just call frames. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-11-18Add documentation for 'file size' commandprpr19xx1-0/+3
2022-08-21docs: update for 0.81+Steve Bennett1-5/+22
Document changes since 0.81 and add documentation for new filename return for sockets. Internal version is now 0.82 in preparation for (eventual) 0.82 release. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-08-20socket: add support for -asyncSteve Bennett1-4/+36
Very similar to Tcl except that read/write can't be done until writable indicates the socket is connected. Signed-off-by: Steve Bennett <steveb@workware.net.au> Documentation fixes - Co-authored-by: Adrian Ho <the.gromgit@gmail.com>
2022-07-25docs: minor asciidoc formatting fixesSteve Bennett1-4/+4
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-06-24jim_tcl.txt: move `defer` doc to proper placeAdrian Ho1-17/+17
Also regenerated `Tcl_shipped.html` to capture doc changes since it was last generated.
2022-04-14aio: TIP 603 - Implement stat of an open file handleSteve Bennett1-0/+5
Although the interface is different ('$handle stat' vs 'chan configure -stat') the behaviour is the same. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2022-04-14try: add support for trapSteve Bennett1-13/+24
In addition to "on codes ..." it is now possible to trap on errorcode with "trap sublist ..." e.g. try { ... } trap CHILDSTATUS {msg opts} { ... } Fixes #204 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-11-28bump version to 0.81Steve Bennett1-3/+3
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-04-03expr: allow existing multiple argument support with --compatSteve Bennett1-1/+1
Some users may not be ready to immediately move to the single-argument expr, so provide a --compat option to configure to support the previous behaviour as a transition strategy. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-03-09expr: TIP 526, only support a single argSteve Bennett1-0/+1
Avoid unexpected issues by concatenating multiple arguments. This does create an incompatibility with early versions, but it is generally trivial to convert existing code to one of two forms: 1. expr {$a + $b} -- usually correct 2. expr "$a + $b" -- usually incorrect Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-02-27docs: Clarify that regexp back references are not supportedSteve Bennett1-0/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-02-27aio: open: support for POSIX open flagsSteve Bennett1-0/+36
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-01-30lsearch, lsort: support for -stride and -indexSteve Bennett1-19/+67
Add -stride support to both lsearch and lsort Add -index support to lsearch Improve -index for lsort to support multiple indices Also harmonise some error messages with Tcl 8.7 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-01-23history: Add support for history keepSteve Bennett1-0/+4
Fixes #191 Signed-off-by: Steve Bennett <steveb@workware.net.au> Reported-by: D. Bohdan <dbohdan@dbohdan.com>
2021-01-09Add the [xtrace] commandSteve Bennett1-1/+24
Allows a debugger or tracing facility to be implemented Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-12-26loop: Allow start value to be omittedSteve Bennett1-2/+4
It is convenient to be able to do just: loop i 5 { body } Where the start value is 0. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-12-26docs: Documentation for integer expressionsSteve Bennett1-12/+23
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-12-26core: support integer expressions in various commandsSteve Bennett1-1/+7
For convenience, many commands now accept integer expressions rather than only simple integers. These are: loop, range, incr, string repeat, lrepeat, pack, unpack, rand This simplifies many cases where previously expr {} or $() was required. e.g. foreach i [range 4+1 2*$b] { ... } string repeat 2**$n a Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-12-11list, string: support any number of +/-n for indexSteve Bennett1-5/+7
It is especially convenient to add -1 for something like: lindex $list end-$BACK-1 or: string range $str $p $p+$len-1 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-11-16expr: TIP 582 - comments in expressionsSteve Bennett1-1/+8
Add support for comments in expressions Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-10-06docs: Fix minor typo in docsSteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-10-05bump version to 0.80Steve Bennett1-1/+1
Update documentation to indicate v0.80 and update Tcl_shipped.html Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-09-23docs: Update docs to indicate recent changes.Steve Bennett1-7/+12
Docs now indicate 0.79+, in preparation for 0.80 release And correctly indicate the changes since 0.79 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-09-23dict: add support for getwithdefault/getdefSteve Bennett1-0/+8
TIP 342 (https://core.tcl-lang.org/tips/doc/trunk/tip/342.md) Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-09-23docs: document operators lt, gt, le, geD. Bohdan1-0/+6
2020-09-23docs: reword paragraph on integer prefixesD. Bohdan1-5/+4
Thanks to @gromgit on GitHub for suggesting this phrasing.
2020-09-23core: implement 0d radix prefix for decimalD. Bohdan1-3/+5
TIP 472
2020-06-25docs: use "empty string" instead of "null string"Steve Bennett1-5/+5
Avoid ambiguity re null characters Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-06-25core: dicts (and arrays) now preserve insertion orderSteve Bennett1-0/+1
Although the documentation has always stated that, like Tcl, insertion order of dictionaries was preserved, this has never been the case. Instead, dictionaries were implemented as simple hash tables that did not preserve order. Now, a new implementation of dictionaries preserves insertion order and has a number of other benefits. Instead of hashing keys and storing keys and values in the hash table, the keys and values are not stored in a separate table, exactly as lists are stored, with alternating key, value pairs. Iterating over the dictionary is exactly like iterating over a list, where the order is consistent. The hash table uses closed hashing rather than open hashing to avoid allocatation of hash entry structures. Instead a fixed (but expandable) hash table maps the key hash to the offset in the key/value table. This use of offsets means that if the key/value table grows, the offsets remain valid. Likewise, if the hash table needs to grow, the key, value table remains unchanged. In addition to the offset (which indexes to the value, and 0 means the hash table entry is unused), the original hash is stored in the hash table. This reduces the need for object comparisons on hash entry collisions. The collision resolution algorithm is the same as that used by Python: peturb >>= 5; idx = (5 * idx + 1 + peturb) & dict->sizemask; In order to reduce collisions, the hash table is expanded once it reaches half full. This is more conservative that Python where the table is expanded when it is two thirds full. Note that if a hash collision occurs and then the original entry that cased the hash collision is removed, we still need to continue iterating when searching for the new key. Don't stop at the now-empty slot. So these entries are marked with offset=-1 to indicate that they need to be skipped. In addition, the new faster hashing algorithm from Tcl 8.7 is used. This the hash for integers to be calculated efficiently without requiring them to be converted to string form first. This implementation is modelled largely on the Python dict implementation. Overall the performance should be an improvement over the current implementation, whilst preserving order. Dictionary creating and insertion should be faster as hash entries do not need to be allocated and resizing should be slightly faster. Entry lookup should be about the same, except may be faster for pure integer keys. Below are some indicative benchmarks. OLD NEW dict-create-1.1 Create empty dict 97.2ns . dict-create-1.2 Create small dict 440ns -27% dict-create-1.3 Create medium dict 1.54us -57% dict-create-1.4 Create large dict (int keys) 130us -80% dict-create-1.5 Create large dict (string keys) 143us -75% dict-set-1.1 Replace existing item 258ns -34% dict-set-1.2 Replace nonexistent item 365ns -49% dict-exists-1.1 Find existing item 55.7ns -5% dict-exists-1.2 Find nonexistent item 55.0ns -5% Signed-off-by: Steve Bennett <steveb@workware.net.au>