See ticket
https://core.tcl-lang.org/tcl/info/26649439c7
You are correct this would have been better marked with a POTENTIAL INCOMPATIBILITY.
[concat] is a string operation that follows a prescribed algorithm of
joining strings together with single intervening spaces after trimming
extra whitespace away. Honestly, it's very weird. It does not reliably produce canonical lists and never has.
% concat {foo bar } " x y\tz\ngrok"
foo bar x y z
grok
% concat foo \{
foo {
Until 8.6.12, the implementation of [concat] contained some
optimizations when arguments were internally of the list type, but those optimizations were producing different results from a non-optimized
approach. Since Tcl commands must treat all equal values (viewed as
strings) the same, independent of internal representation and type, this violation was fixed.
Note that your example use of [concat] still produces a list, a list
containing all the same elements. Only the element formatting has
changed.
To get the same result you are accustomed to...
% concat $lst1 $lst2
a {#b} #c
% list {*}$lst1 {*}$lst2
a #b #c
On 11/6/21 8:36 AM, Erik Leunissen wrote:
List elements having a leading "#" character are handled specially if
they are the first element of a list:
% set lst1 [list a]
a
% set lst2 [list #b #c]
{#b} #c
%
With Tcl8.6.11, joining these two lists using [concat] squashes one
level of grouping (as documented) and gives the result (as I expected):
% concat $lst1 $lst2
a #b #c
%
However, with Tcl8.6.12 (and Tcl8.7a5) I get:
% concat $lst1 $lst2
a {#b} #c
%
Which of these two behaviours is correct, and why?
Thanks in advance,
Erik Leunissen
--
| Don Porter Applied and Computational Mathematics Division |
|
[email protected] Information Technology Laboratory |
|
http://math.nist.gov/~DPorter/ NIST | |______________________________________________________________________|
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)