Skip to content
Tcl Source Code Artifact [4712a9be30]
Login

Artifact [4712a9be30]

Artifact 4712a9be3002709d34f55ba3aa595449d4e7c0f5b9a74c882eebaf83fb038f5e:

Ticket change [4712a9be30] - New ticket [b55589c55b36c990|b55589c55b] <i>the lset command cannot change the size of a list</i>. by rbucker on 2023-02-17 14:41:26.
D 2023-02-17T14:41:26.408
J assignee nobody
J closer nobody
J cmimetype text/x-markdown
J comment The\sdoc\ssays...\r\n\r\nThe\sinteger\sappearing\sin\seach\sindex\sargument\smust\sbe\sgreater\sthan\sor\sequal\sto\szero.\sThe\sinteger\sappearing\sin\seach\sindex\sargument\smust\sbe\sstrictly\sless\sthan\sthe\slength\sof\sthe\scorresponding\slist.\sIn\sother\swords,\sthe\slset\scommand\scannot\schange\sthe\ssize\sof\sa\slist.\sIf\san\sindex\sis\soutside\sthe\spermitted\srange,\san\serror\sis\sreported.\r\n\r\nmy\stest\scase:\r\n\r\n```\r\nset\sabc\s[list\sa\sb\sc];\r\nputs\s"${abc}";\r\nputs\s"[lset\sabc\s2\sx]";\r\n\r\n\r\n#\serror\scases\r\nputs\s"[catch\s{lset\sabc\s-2\sx}\sres]\sres:$res";\r\nputs\s"[llength\s${abc}]";\r\nputs\s"[catch\s{lset\sabc\s14\sx}\sres]\sres:$res";\r\nputs\s"[catch\s{lset\sabc\s13\sx}\sres]\sres:$res";\r\nputs\s"[catch\s{lset\sabc\s12\sx}\sres]\sres:$res";\r\n\r\nputs\s"[catch\s{lset\sabc\s3\sx}\sres]\sres:$res";\r\nputs\s"[llength\s${abc}]";\r\nputs\s"[catch\s{lset\sabc\s4\sx}\sres]\sres:$res";\r\nputs\s"[llength\s${abc}]";\r\n```\r\n\r\nreturns\r\n\r\n```\r\na\sb\sc\r\na\sb\sx\r\n1\sres:list\sindex\sout\sof\srange\r\n3\r\n1\sres:list\sindex\sout\sof\srange\r\n1\sres:list\sindex\sout\sof\srange\r\n1\sres:list\sindex\sout\sof\srange\r\n0\sres:a\sb\sx\sx\r\n4\r\n0\sres:a\sb\sx\sx\sx\r\n5\r\n```\r\n\r\nNotice\sthat\swhen\sthe\sindex\sis\sexactly\sthe\slength\sof\sthe\slist\sthat\sthe\snewvalue\sis\sappended\sto\sthe\slist,\showever,\sthe\sdoc\ssays\s"STRICTLY"\scannot\schange\sthe\ssize\sof\sthe\slist.
J foundin 8.6
J is_private 0
J login rbucker
J priority 5\sMedium
J private_contact f1cbdd73b57f5bd1c724efe36f7caf833f36d58f
J resolution None
J severity Important
J status Open
J submitter rbucker
J subsystem 14.\sList\sObject
J title the\slset\scommand\scannot\schange\sthe\ssize\sof\sa\slist
J type Bug
K b55589c55b36c9908294e1f9631ea98ca98d6ae9
U rbucker
Z 866206140b18406248a2027b69d46d06