Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2022-11-28
14:42 • Ticket [37f485b87c] # Error in lreplace. status still Closed with 5 other ch... artifact: a865834e56 user: dgp
2022-11-27
22:42 • Closed ticket [37f485b87c]. artifact: 57690b1001 user: jan.nijtmans
17:01 • New ticket [37f485b87c]. artifact: bc24f3a102 user: anonymous

# Error in lreplace.

Closed / Works For Me37f485b87c6e00dc917ff014e363d6ea31e404f9Created 4 years agoUpdated 4 years ago
Descriptionplain2022-11-27 17:01:10
########################################################
# Error in lreplace.
########################################################
puts "$::tcl_patchLevel\n$::tcl_platform(os); $::tcl_platform(machine);\
 $::tcl_platform(platform); $::tcl_platform(osVersion); $::tcl_platform(wordSize);"
if { [catch { set var [lreplace {a b c d e} 12345 end+2 f g h i] } res ] } {
  puts "res = $res"                                                            
}
########################################################
#Output:
Windows NT; intel; windows; 10.0; 4;
res = list doesn't contain element 12345
########################################################
# But, according https://tcl.tk/man/tcl/TclCmd/lreplace.htm, must be var=
#a b c d e f g h i
########################################################
jan.nijtmanswiki2022-11-27 22:42:19

I get:

% lreplace {a b c d e} 12345 end+2 f g h i
a b c d e f g h i

So works for me

dgpplain2022-11-28 14:42:58
This was fixed in release 8.6.9 long ago.

Update to 8.6.13 is recommended.
Log in (anonymous is fine) to add a comment.