Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
To open, socket and accept
Also document aio getfd
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
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>
|
|
|
|
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>
|
|
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>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Also regenerated `Tcl_shipped.html` to capture doc changes since it was last generated.
|
|
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>
|
|
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>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
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>
|
|
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>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
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>
|
|
Fixes #191
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Reported-by: D. Bohdan <dbohdan@dbohdan.com>
|
|
Allows a debugger or tracing facility to be implemented
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
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>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
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>
|
|
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>
|
|
Add support for comments in expressions
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Update documentation to indicate v0.80
and update Tcl_shipped.html
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
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>
|
|
TIP 342 (https://core.tcl-lang.org/tips/doc/trunk/tip/342.md)
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
|
|
Thanks to @gromgit on GitHub for suggesting this phrasing.
|
|
TIP 472
|
|
Avoid ambiguity re null characters
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
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>
|
|
The hash table used to store commands now uses Jim_Obj keys rather
than allocated char *, so embedded nulls are supported.
This means that some API function such as Jim_RenameCommand()
now take Jim_Obj * rather than const char *, however Jim_CreateCommand()
is retained with const char * for convenience and the new Jim_CreateCommandObj()
is added.
This is generally a performance win as the existing Jim_Obj can be used
as the key.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Allows a psuedo-tty pair to be created.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
For some SSL connections it is necessary to set the Server Name
Indication in the connection in order to receive the correct
certificate. Allow this as part of the client ssl call with:
$sock ssl -sni $servername
Also for -server mode, allow the certificate and private key to be
stored in a single file and only be specified once.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
We can't use feof() and 'buffering none' on ssl connections.
Instead we have to get eof from the ssl layer, and provide
special handling for buffering in the eventloop.
For eof, add ssl_eof() and detect SSL_read() results that indicate
eof to set AIO_EOF in flags.
For buffering, add 'read -pending' that will read, and then immediately
read any buffered data so that the 'readable' event will trigger next
time.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
regsub -all matches \A against the start of each match, but
correctly handle a pattern like ^ which does not advance the
match
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Use the same name for this subcommand as Tcl.
For now we keep the existing package list in case it is in use.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
With some additional minor cleanups
Fixes msteveb/jimtcl#143
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Add a note in the documentation for clock that some systems
use 32-bit time_t and are thus not year 2038 compliant.
Also add a test to catch this in clock.test
Reported-by: dbohdan <dbohdan@dbohdan.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Fix few typos in the documentation
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|