<i>[string length] reports a length of 2 for a single character</i> status still Closed with 4 other changes
by
.
D 2022-03-07T15:33:41.701
J closedate 2459646.14839932
J icomment \r\nAnother\sprogramming\sinference\sthat\smight\scommonly\sbe\sin\suse:\r\n\r\n\s\s[llength\s[split\s$s\s{}]]\s==\s[string\slength\s$s]\r\n\r\nWe\scould\suse\sa\slist\sof\ssuch\s"Gotchas!"\sto\scall\sattention\sto\r\nin\sa\smigration\sguide\sto\sTcl\s8.7.\s\sThese\sloops\sno\slonger\sreliably\r\nimplement\sthe\ssame\sfunction\sin\sTcl\s8.7:\r\n\r\nforeach\sc\s[split\s$s\s{}]\s{process\s$c}\r\n\r\nfor\s{set\si\s0}\s{$i\s<\s[string\slength\s$s]}\s{incr\si}\s{process\s[string\sindex\s$s\s$i]}\r\n\r\nHere\sagain,\sthe\sexpectations\sof\sfunctional\sequivalence\sare\srestored\sin\sTcl\s9.
J login dgp
J mimetype text/plain
K 141c6f5621e9c9e881f63fbf28c473955b6adae0
U dgp
Z b29119e9de911650ca54c30382fdeffa