Artifact
91d0711c7afe04f872d51a14288b7e9800c728b7:
Ticket change
[91d0711c7a]
- New ticket
[862526872cda0746|862526872c] <i>Getting another object of the same type in dict and list for performance</i>.
by
anonymous on
2015-04-20 17:44:24.
D 2015-04-20T17:44:24.472
J assignee nobody
J closer nobody
J cmimetype text/plain
J comment When\sgetting\san\selement\sof\sa\slist\susing\s"lindex"\sor\sgetting\san\selement\sof\sa\sdict\susing\s"dict\sget",\sthe\sprocedure\sreturns\sa\sstring.\r\n\r\nIn\sthe\ssituation\sthat\ssome\suser\swants\sto\straverse\srecursively\sthis\sdata\sstructure,\sor\swants\ssimply\sa\ssubnode\sof\sthis\sdata\sstructure\sfor\sprocessing\she\shas\sto\sconvert\sthe\sstring\sinto\sa\sdict\sor\sa\slist\sagain.\r\n\r\nI\swould\sbe\snice\sa\ssubcommand\ssimilar\sto\sthis:\r\n\s\s\s\s-\sdict\ssubnode\skey?\skey?\skey?\s...\r\n\s\s\s\s-\slist\ssubnode\skey?\skey?\skey?\s...\r\n\r\nThis\ssubcommand\sreturns\sthe\ssubnode\swith\sthe\ssame\stype\sas\sthe\scontainer\sfor\sthat\skey.\sI\smean\sthat\s"dict\ssubnode"\sshould\sreturns\sanother\sdict\sand\s"list\ssubnode"\sanother\slist.\r\n\r\nThis\snew\ssubcommand\swould\sbe\sinteresting\sfor\sperformance\smanipulating\scomplex\sdata\sstructures.\r\n\r\nThis\sscript\sshows\sthat\s"dict\sget"\sand\s"lindex"\sreturns\sa\sstring\sobject\sinstead\sof\sa\sdict\sor\slist\sobject:\r\n\r\nset\sa\s[list\s1\s2\s{1\s1\s2332\s{12\s12}\s}\s23]\r\nputs\s"a\sinner\srepresentation:\s\\n\\t[::tcl::unsupported::representation\s$a]\\n"\r\n\r\nset\sb\s[lindex\s$a\s2]\r\nputs\s"b\sinner\srepresentation:\s\\n\\t[::tcl::unsupported::representation\s$b]\\n"\r\n\r\nset\sc\s[dict\screate\skey1\sval1\skey2\s{key21\sval21\skey22\s{key221\sval221}\s}\skey3\sval3]\r\nputs\s"c\sinner\srepresentation:\s\\n\\t[::tcl::unsupported::representation\s$c]\\n"\r\n\r\nset\sd\s[dict\sget\s$c\skey2\skey22]\r\nputs\s"d\sinner\srepresentation:\s\\n\\t[::tcl::unsupported::representation\s$d]\\n"
J foundin 8.6
J is_private 0
J login anonymous
J priority 5\sMedium
J private_contact 1c4b6cdb98c9dfc4d1e74018f3f4efa00ad217e2
J resolution None
J severity Minor
J status Open
J submitter anonymous
J subsystem -\sNew\sBuiltin\sCommands
J title Getting\sanother\sobject\sof\sthe\ssame\stype\sin\sdict\sand\slist\sfor\sperformance
J type Bug
K 862526872cda074626d8a1e020479acf44ed7009
U anonymous
Z ff3eb9db09d93800c3d881d19e833a1e