Both are. What you see as the result of 'concat' is the string representation of the list, and obviously 8.6.12 decides to add more
quoting for some reason.
If you inspect the list, you get identical contents in 8.6.11 and 8.6.12:
% info patchlevel
8.6.11
% set lst1 [list a]
a
% set lst2 [list #b #c]
{#b} #c
% set lst3 [concat $lst1 $lst2]
a #b #c
% foreach elt $lst3 { puts $elt }
a
#b
#c
% info patchlevel
8.6.12
% set lst1 [list a]
a
% set lst2 [list #b #c]
{#b} #c
% set lst3 [concat $lst1 $lst2]
a {#b} #c
% foreach elt $lst3 { puts $elt }
a
#b
#c
HTH
R'
..
concat $result [list #00ff00 #00ff00 #00ff00]
...
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
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
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
... etc
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
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 285 |
Nodes: | 16 (2 / 14) |
Uptime: | 24:07:35 |
Calls: | 6,448 |
Files: | 12,050 |
Messages: | 5,254,261 |