Skip to content
Tcl Source Code Artifact [3c3c129373]
Login

Artifact [3c3c129373]

Artifact 3c3c129373a4a88a38c27b76bf5cd68e3bc67adfc8958a6eea41d37a2610a9f5:

Ticket change [3c3c129373] - Ticket [3598385fffffffff|3598385fff] <i>[dict exists] doesn&#39;t produce an error for non-dict values</i> status still Closed with 5 other changes by aspect on 2018-05-21 00:23:35.
D 2018-05-21T00:23:35.741
J closedate 2458259.51638589
J closer aspect
J icomment +1\serror.\r\n\r\nI\sdon't\sthink\sthe\scases\sshould\sbe\sdistinguished:\s\s[dict\sget\s{a\sb}\sa\sb]\sis\sexactly\sthe\ssame\scategory\sof\serror.\s\sConsidering\sit\sa\sbug\sfor\s[3475264]\swas\stoo\shasty.\s\sDictionaries\swith\snon-dict\sleaves\sare\sonly\srecursive\sstructures\suntil\syou\shit\sa\sleaf\s-\sapplying\stoo\smany\skeys\swith\s[dict\sexists]\sis\sjust\sas\swrong\sas\sdoing\sso\swith\s[dict\sset]\sor\s[dict\sget].\r\n\r\nLet\sme\semphasise:\s\san\sarbitrarily-shaped\stree\swith\svalues\sat\sthe\sleaves\sis\snot\ssimply\srepresented\sin\sa\sdict,\ssince\sthose\svalues\smay\saccidentally\slook\slike\sdicts.\s\sWe\sall\sknow\sthis,\sbut\sI've\sseen\smyself\sand\sothers\sstumble\son\sit\smany\stimes.\s\sI\sthink\s[3475264]\scame\sfrom\sthe\ssame\smistaken\splace,\sand\sI\sstruggle\sto\simagine\scorrect\scode\sthat\scould\sbe\srendered\sincorrect\sby\san\serror\sbeing\sraised\sin\sthat\scase.\r\n\r\n\r\nIn\s[3475264]\sticket\sdkf\sobserved:\r\n\r\n>\sbased\son\sthe\scurrent\sdocumentation\sit\sshould\snot\sbe\sthrowing\serrors\r\n\r\nwhich\sis\sfalse:\s\sthe\smanual\sprescribes\sonly\swhen\s[dict\sexists]\sreturns\strue.\r\n\r\n\r\nThe\scurrent\ssituation\sis\sasymmetric\sand\ssurprising\son\sat\sleast\stwo\scounts:\r\n\r\n1.\sEvery\sother\sdict\ssubcommand\sraises\san\serror\swhen\sasked\sto\streat\sa\snon-dict\svalue\sas\sa\sdict.\r\n\r\n2.\sthe\s(implicit\sbut\sobvious)\sidentity\sis\sbroken:\r\n\r\n\s\s[dict\sexists\s$d\s$k\s...]\s\s==\s\s[dict\sexists\s$d\s$k]\s&&\s[dict\sexists\s[dict\sget\s$d\s$k]\s...]\r\n\r\nas\sa\suser\sI\sexpect\sthis\sbecause:\r\n\r\n\s\s[dict\sget\s$d\s$k\s...]\s\s==\s\s[dict\sget\s[dict\sget\s$d\s$k]\s...]\r\n\r\n3.\s{[dict\sexists\s$d\s{*}$k]\s==\s0}\sdoesn't\stell\sme\sthat\s[dict\sset\s$d\s{*}$k]\swill\ssucceed
J login aspect
J mimetype text/x-fossil-wiki
K 3598385fffffffffffffffffffffffffffffffff
U aspect
Z 705add5de96e37773229fa1ae62907a8