Ticol Tcl - Bugs and Issues

Good bug reports are, welcomed although as this is a hobby project I can't guarantee a fix time or detailed reply. When submitting a bug report, try to be as detailed as possible, include copies of any relevant scripts and, if possible, screenshots. Keep the total email size < 1Mb

Before submitting a bug report, check out the "Tips and Tricks", "Ticol Workarounds" and "Troubleshooting and Common Mistakes" sections of the manual Bug reports or change/feature requests may be sent to 'ticol' @ this domain

Latest Bugfixes and Improvements - January 2022

Status Comments
Fixed [expr] expression-handler issue with orphaned leading + and - signs adjacent to brackets
Added [precision] which returns the effective precision of a double/float/real number
Fixed [struct unset] can now unset more than one struct and behaves like [unset]
Fixed [big graph -nonewline] now honoured
Fixed [file_crc] now reports missing file errors
Fixed Regression bug. Invalid free in [array set]
Fixed Bug in braced variable handling which incorrectly returned a list
Fixed Changed mode of run lock operation in [run] re: ticol.dll calling methods
Added [console] command will show the console on error
Fixed Regression bug in [readfile] file pointer advance
Fixed [spawn] now works with ticol.dll and wintest.exe
Added 2d and 3d [carray] handling. Command syntax changed to handle this
Added Implemented MPP macro variable setting from macro consts
Added Embedded exe - tcl2bat.exe
Fixed Amended [puts] console handling for DLL version - ticol.dll
Fixed [inspect] no longer prints NPCs to the console
Added File open retry option to [file open] and [readfile] with 1s delay between attempts
Fixed Varray regression small memory leak
Fixed tcl2c.exe to create correct 'split' strings for MSVC5.0+
Fixed ticol.dll now stable with wintest.exe and ticol_stub.exe on all unit tests
Added More unit tests to tests.tcl
Fixed [mapdrive] plugin improved error case returns
Fixed Regression in non-decimal consts replacements and escape handling
Fixed [varray foreach] now returns correct record count
Fixed [carray sort -numeric -reverse] sorting
Added [carray add] at existing position
Added [carray sort -rvalue]
Added [carray sort -numeric]
Added Completed more [carray] functionality and updated help file
Fixed Changed [puts] handling of wrapping braces when called from expansion {*}
Fixed [stack unset varname] success returned 0, should have been 1
Fixed Updated documentation including adding [floop] (float looping)
Added A few more embedded Ticol + Script interpreter exe examples
Added MicroApache test webserver CGI distro (not for production use, test use only)
Added Sample C/C++ DLL calling project
Added [date X -format H:i:s]
Addded [date now -format r]
Fixed [in], [ni] '-' prefix argument handling

Top

Features Not Fully Implemented

Description Comments
Dictionaries These have not been a priority so [dict] is feature incomplete and may have bugs.
Finishing [dict] is very low priority work as I have yet to find a use for it
Multi-threading The underlying design and architecture of Ticol does not readily lend itself to multi-tasking but an experimental compile has been produced which can multi-task simple scripts. This version is far from reliable
[after] Currently unthreaded in the release version
[join] Almost complete.  Some work needed
Namespaces Emulation only. It is very unlikely that a full implementation will be done as emulation is currently enough
[big] floating point Apart from a small number of subcommands, [big] is an integer only plugin. Full floating point number implementation is desireable
[big] size limit [big] numbers are currently subject to a 6,000 digit hard limit
[array unset] Does not accept a glob search spec
[ls] [ls] is feature incomplete
[binary] Only a few subcommands implemented. More may follow (See: help binary)
[glob] Partially implemented. Functionally incomplete (See: help glob)
[match] Partial implementation. Character groups not yet supported (See: help match)
[option] Stack not yet implemented for [option push|pop]. Only one level of save is active (See: help option)
ticol.dll DLL version of the Ticol interpreter. All unit tests pass, but the DLL may be incompatible when linked from some environments. Successfully linked and tests run from C++ as an EXE and from Visual BASIC 5.0

Top

Problematic Features

See the troubleshooting and faq sections of the manual for more information

Description Comments
Escape sequences Constant sequences such as \n are handled primarily by the Macro PreProcessor but literal backslash characters and escaped double-quotes are problematic.  Not all command endpoints unescape escaped strings. Workarounds to give more control over double-escaping are to use the [escape] and [unescape] commands
Strings within strings You cannot embed strings within strings or embed in certain other exceptional cases. However, braces can be used to group characters as a string.
set a("with spaces") Hello
- is allowed but embedding a quoted string inside an assumed string ...
set q a("with spaces")
will result in a malformed string, e.g. 'a("with spaces)'

A string may be assigned with escaped double-quotes and these may be unescaped on use
set q "a(\"Hello world\")"
puts [unescape $q]

Braces do not group within array subscripts of string literals containing whitespace Not a bug
Braces fail to 'group' when setting array elements containing whitespace
[set] does not handle braced arguments for arrays
The code to handle this is not implemented. ActiveState Tcl has the same behaviour

e.g.   set a({Hello world}) 23   # Fails

Workaround:
Wrap the subscript in double quotes rather than braces
Workaround:
Pass a variable containing the string literal containing whitespace rather than a string literal

[calldll_*] byte widths Currently widths can be specified using a trailing colon separator. This is far from ideal and a better solution will have to be found
[option expression] If the incorrect mode is selected for the language style being used then loops may not terminate
[option expression] gives a programmer the choice of using Tcl or [expr] syntax for flow-control structures such as [if], [for], [while] etc. This can be changed dynamically at runtime. It is strongly recommended that either ticol.ini be configured to a preference or each script begins with an appropriate option expression statement
Hash, # character A hash character may be used in quoted strings. Use the escape sequence \#
A hash character encountered outside of a double-quoted string will be interpreted as a comment
You may also use [chr 35] to emit a #
To support the Macro Preprocessor the # character is replaced by @ in upvar and uplevel
Functional if (?:) Can be problematic with nested functional if constructs.   Command [if] is preferable
[lmap] Works slightly differently to ActiveState tcl. Investigating a rewrite to make fully-compatible

Top

Common Tcl Features Not Implemented

Description Comments
Unicode / Multi-Byte Character Set Strings etc. From the outset there was no design requirement to handle international character sets and there was a desire for maximum reuse of existing legacy C++ code. The requirements for the project were satisfied by producing an ANSI-only language capability
Native Unicode and foreign language support will never be implemented. If you require Unicode support then use ActiveState or another Tcl
Regular Expressions There was no immediate requirement for regex support. I wanted to write as much as possible of the C++ library code from the ground upwards and I had no working regex library code. The [scan] and [string match] commands are often a useful substitutes. I have an experimental regex code base but this is not release quality
"Scientific" format numbers e.g. 2E85. These have not been required but can be handled via ticol_sci.dll's [dec] and [sci], but could also perhaps be implemented via the Macro PreProcessor
[lset] This is currently a string operation, partnered with [rset]. A rewrite is planned to bring this into line with standard Tcl
Multi-line paste into the CLI This would be a desireable feature which may get implemented when time can be found but which would require significant alteration to the CLI code
Full socket library commands I didn't really need these and any socket-related commands have been implemented as specialised routines. e.g. SMTP mail, PING
If socket support is needed then it is recommended to use ActiveState or another Tcl
Some [file] subcommands A small number of less-useful [file] sub-commands have been omitted, esp. when these are not relevant to Windows
Classes/objects Classes (proper) are not implemented. However, class-like behaviour can be simulated. See the percent graph object demo
CLI Editor As Notepad++ is such a nice editor there has been no reason to invest time in producing a direct CLI editor which would not get used
Bytecode compiler Maybe one day when I learn more about this although experiments with the Pseudo Assembler, TicoASM showed that an array based, preparsed language which calls precompiled routines can be pretty fast?
ActiveState Tcl fills the need for a fast, optimised Tcl script language
Tk GUI support Not required and not implemented
[interp] Mooted but not yet implemented. May be added as a plugin as I can't see this being terribly useful for Ticol
Namespaces Emulated only. I found I had no real need for full namespace support. Emulation is sufficient to create fake 'namespaces'
Syntax checking Pre-execution syntax checking is either minimal, via the MPP or absent. Rudimentary syntax-checking is performed on bracket parity only

Top

Known Bugs

Description Comments
- Any major new bugs which cannot be resolved will be recorded here
[expr] with functional ? if Works well with simple expressions. Nested, one-line expressions are not handled well
It is suggested that functional ifs are avoided in [expr]. Used procs instead
Stack overflow Stack overflows are trapped but not always reported descriptively as such
Cannot set array variable using a 'naked' string literal containing escaped whitespace This is because the Macro PreProcessor (MPP) translates escaped tokens before [set] sees the string. Thus, source code is presented which is devoid of escape characters. If you must use string literals with space characters, wrap the string in double-quotes.

set a(Hello\ world) 23   # Fails  * FIXED *
set a(Hello\tworld) 23   # Fails  (not fixable due to MPP translation)

Workaround:
Wrap the subscript in double quotes
Workaround:
Pass a variable containing the string literal containing whitespace rather than a string literal

* FIXED *

Problems unsetting array subscripts containing literal strings with white space

Avoid using literal strings containing whitespace for array element subscripts
You can create an array element such as:     set a("Hello world") 23
But this cannot be unset using:                        array unset a("Hello world")


Workaround 1:
Use:   array unset "a(Hello world)"
Workaround 2:
Pass a variable containing the string literal containing whitespace rather than a string literal
* FIXED *

Array elements which have subscripts containing escaped characters are stored literally

Array subscripts which contain strings containing whitespace which have escaped characters are stored in the their literal, unescaped form..
[set] peforms no translation on escapes.  Such subscripts would normally be supplied by double-quoted literals or a variable
Thus a quoted string literal can't be used to resolve such array elements. This affects quoted spaces not tabs (\t)

set a("Hello\ world") 23  # Set using a space escape  * FIXED *
puts $a("Hello\ world")   # Returns 23
* FIXED *
puts $a("Hello world")    # Fails to resolve
  * FIXED *
set a("Hello\tworld") 24  # Set using a tab escape
  * PASS *
puts $a("Hello\tworld")   # Returns 24
  * PASS *

Workaround:
Pass a variable containing the string literal containing whitespace rather than a string literal

Back | Top

Last updated on 29 January 2022 - This page is designed for 1024 x760 and higher resolution displays