<i>lseq "count" argument also dictates output formatting</i> status still Open with 3 other changes
by
.
D 2024-08-30T15:31:54.650
J icomment It\slooks\scompletely\sfine\sand\sdesirable\sto\sme...\r\nAlso\scode\ssays\sit\s(I\sknow\sthat\sexactly,\sbecause\sI\stouched\sit\sas\sI\sfixed\slseq\sin\s[f05f5ef759]\sand\sit\swas\spretty\sobvious\sintentional).\r\n\r\nI\ssee\sit\ssimply\sas\san\sequivalent\sof\s<code><b>lseq</b>\s?0\sto?\s<b>3.0</b></code>\s(further\sbelow).\r\n\r\n<i>>two\slogically\sequivalent\ssequences\sdo\snot\shave\sthe\ssame\sstring\srepresentation</i>\r\n\r\nNothing\sis\shere\sequivalent.\r\nWhy\sdon't\syou\snot\swonder\sthat\sfollowing\sare\sdifferent?\r\n<code><pre\sstyle="padding-left:10pt">\r\n%\sstring\scompare\s[expr\s3]\s[expr\s3.0]\r\n-1\r\n%\sstring\scompare\s[expr\sint(3)]\s[expr\sdouble(3)]\r\n-1\r\n</pre></code>\r\nI\sknow\sin\syour\sworld\sEIAS,\sbut...\sthe\smatter\sof\sstring\srepresentation\shas\snothing\sto\sdo\swith\slseq\sand\scompletely\sto\sneglect\shere.\r\n\r\nMost\sinteresting\sis\sthe\squestion\swhat\swould\shappen\sif\sthe\sobject\sgets\sshimmer\sinternally\sto\sdouble.\sAnd\sthis\scan\sbe\sanswered\sas\sit'd\sbehave\scorrect.\sJust\sbecause\san\sentier\swould\snever\sshimmer\sto\sfloating\stype\s(because\sits\sstring\srepresentation\swouldn't\sconcur\sfor\sboth\stype).\r\nWith\sother\swords\sbecause\sTcl_GetDoubleFromObj\sand\sco\swould\sobtain\sdouble\sfrom\sinteger\swithout\sto\sshimmer:\r\n<code><pre\sstyle="padding-left:10pt">\r\n%\slist\s[set\si\s[expr\s3]]\s[tcl::unsupported::representation\s$i]\r\n3\s{value\sis\sa\sint\s...}\r\n%\slseq\s$i\r\n0\s1\s2\r\n%\slist\s[expr\s{double($i)}]\s[tcl::unsupported::representation\s$i]\r\n3.0\s{value\sis\sa\sint\s...}\r\n%\slseq\s$i\r\n0\s1\s2\r\n</pre></code>\r\n\r\nSo\sshimmering\sissue\sis\sexcluded.\sNothing\selse\smatters.\r\n\r\nMoreover\slseq\snatively\ssupports\sexpressions,\sso\s<code>lseq\s3.0</code>\sis\squasi\sequivalent\sto\s<code>lseq\s[expr\s{3.0}]</code>\sand\sthis\sis\salso\spossible\s(and\sdeliberate):\r\n<code><pre\sstyle="padding-left:10pt">\r\n%\slseq\sdouble(3)\r\n0.0\s1.0\s2.0\r\n</pre></code>\r\n\r\n\r\n<i>>\sSpecially\shere\sis\sclear\sthat\sthe\scount\sis\san\sentier:<br/>\r\n>\s%\slseq\s3.5<br/>\r\n>\sexpected\sinteger\sbut\sgot\s"3.5"</i><br/>\r\n\r\nIt\sis\snot\sclear\sto\sme.\sIMHO,\sit\sis\ssimply\sundefined\scurrently,\sbut\seasy\stoo\sfix:\r\nTo\sbe\sconsistent,\sI'd\srather\sprefer\sto\schange\sthe\scommand\sso\sthis:\r\n<code><pre\sstyle="padding-left:10pt">\r\n%\slseq\s3.0\r\n0.0\s1.0\s2.0\r\n%\slseq\s3.5\r\n0.0\s1.0\s2.0\s3.0\r\n#\swith\sother\swords\sit'd\sbecome\sshort\sequivalent\sto:\r\n%\slseq\s0\sto\s3.5\r\n0.0\s1.0\s2.0\s3.0\r\n</pre></code>\r\nAnd\sdocumentation\scan\sbe\schanged\sfrom:\r\n<code><pre\sstyle="padding-left:10pt">\r\n<b\sstyle="color:red">-\slseq\sstart\s?(..|to)?\send\s??by?\sstep?</b>\r\n<b\sstyle="color:green">+\slseq\s?start\s?(..|to)??\send\s??by?\sstep?</b>\r\n\s\slseq\sstart\scount\scount\s??by?\sstep?\r\n<b\sstyle="color:red">-\slseq\scount\s?by\sstep?</b>\r\n</pre></code>\r\nwhere\sstart\sis\sby\sdefault\s0\s(or\s0.0\sin\scase\sof\sdouble\send)<br/>\r\n\r\nIt'd\sbe\smuch\ssimpler\sand\smore\sconsistent.\r\nBut\sit'd\sbe\sjust\snice\sto\shave.
J login sebres
J mimetype text/x-fossil-wiki
K f4a4bd7f107031f273642cbaefc3cbed72315b1f
U sebres
Z 61a1e0751813048e4d2a95279ff49ab0