<i>Evaluating something starting with a # fails to treat it as a comment</i>.
by
.
D 2014-04-04T04:30:01.483
J assignee nobody
J closer nobody
J cmimetype text/plain
J comment So\sI\sdecided\sto\sstop\sliving\sin\sthe\spast\sand\supgraded\sfrom\sTcl\s8.4\sto\s8.6.\sAnd\sgot\sbitten\sby\ssomething\sthat\sused\sto\swork\sjust\sfine:\r\n\r\nFirst,\sthe\sexpected\sbehavior:\r\n\r\ntclsh8.6\r\n%\sset\stcl_patchLevel\r\n8.6.1\r\n%\sset\scomment\s"#fubar\ssnafu"\r\n#fubar\ssnafu\r\n%\slindex\s$comment\s0\r\n#fubar\r\n%\seval\s$comment\r\n%\s\r\n\r\nNow\sthe\ssame\sthing\swith\sa\slist.\sNote\sthat\sin\sTcl\s8.4,\sthe\scommands\sbelow\sworked\sidentically\sto\sthe\sabove.\s\sNot\sso\sin\s8.6:\r\n\r\n%\sset\scomment\s[list\s#fubar\ssnafu]\r\n{#fubar}\ssnafu\r\n%\slindex\s$comment\s0\r\n#fubar\r\n%\seval\s$comment\r\ninvalid\scommand\sname\s"#fubar"\r\n\r\nLooks\slike\sa\sbug\sin\sparsing.\sThe\sfirst\sword\sof\sthe\slist\sis\sunquestionably\sthis:\r\n\r\n#fubar\r\n\r\nThis\sis\sclear\sfrom\sthe\sresult\sof\s'lindex'\sand\sfrom\sthe\slanguage\srules\s(http://www.tcl.tk/man/tcl8.6/TclCmd/Tcl.htm):\r\n\r\n"If\sthe\sfirst\scharacter\sof\sa\sword\sis\san\sopen\sbrace\s(“{”)\sand\srule\s[5]\sdoes\snot\sapply\s...\sThe\sword\swill\sconsist\sof\sexactly\sthe\scharacters\sbetween\sthe\souter\sbraces,\snot\sincluding\sthe\sbraces\sthemselves"\r\n\r\nand\r\n\r\n"If\sa\shash\scharacter\s(“#”)\sappears\sat\sa\spoint\swhere\sTcl\sis\sexpecting\sthe\sfirst\scharacter\sof\sthe\sfirst\sword\sof\sa\scommand,\sthen\sthe\shash\scharacter\sand\sthe\scharacters\sthat\sfollow\sit,\sup\sthrough\sthe\snext\snewline,\sare\streated\sas\sa\scomment\sand\signored.\sThe\scomment\scharacter\sonly\shas\ssignificance\swhen\sit\sappears\sat\sthe\sbeginning\sof\sa\scommand."\r\n\r\nWell,\sI\sdo\shave\s#\sin\sfirst\scharacter\sof\sthe\sfirst\sword\sof\sthe\scommand.\sWhy\sis\sTcl8.6\snot\streating\sit\sas\sa\scomment???\r\n\r\nWhile\sI\sdon't\shave\sa\snewline\sin\shere,\snewlines\sare\sseparators\sand\sI\shave\sone\scommand\sto\sevaluate,\sso\sseparator\spresence\sis\smoot.\sBut\slet's\sadd\sit:\r\n\r\n%\seval\s"$comment\\n"\r\ninvalid\scommand\sname\s"#fubar"\r\n\r\nStill\snot\sgood.\r\n\r\nLooks\slike\sa\sclear\sbug\sto\sme.
J foundin 8.6.1
J is_private 0
J login Grumpy\sCoder
J priority 5\sMedium
J private_contact 51e6fca6c11afbb182a55eb093d92ab68ef5a61b
J resolution None
J severity Important
J status Open
J submitter Grumpy\sCoder
J subsystem 45.\sParsing\sand\sEval
J title Evaluating\ssomething\sstarting\swith\sa\s#\sfails\sto\streat\sit\sas\sa\scomment
J type Bug
K 1e95cbaf89ad0e0d48aa374d7ad0515ea2c2b862
U Grumpy\sCoder
Z 540e86a2030df61597df88b47360d27f