<i>EXPR with single substitution</i> status still Closed with 4 other changes
by
.
D 2004-11-23T08:37:23
J icomment Logged\sIn:\sYES\s\nuser_id=148712\n\nThe\sbasic\sfunctioning\sof\sTcl\sis\sdescribed\sin\sTcl.n\sas:\n\s\s\s1.\sthe\sparser\ssubstitutes\sthe\swords\sin\sthe\scommand\sline\n\s\s\s2.\sthe\sfirst\sword\sin\sthe\ssubstituted\sline\sis\scalled\sas\sa\ncommand,\swith\sthe\sremaining\swords\sas\sarguments.\sThe\scommand\nmay\sinterpret\sits\sarguments\sin\sany\sway\sit\schooses.\n\nThis\sis\strue\sfor\severy\sTcl\scommand\s-\swhether\sbuilt-in,\sor\sa\nproc,\sor\sa\sC-coded\sextension\scommand.\sIn\sa\ssense,\sthis\s*is*\nwhat\sTcl\sis.\n\nThus,\sthe\ssubstitution\sby\sthe\sTcl\seval-loop\scannot\sbe\navoided\swithout\sdestroying\sTcl's\ssimplicity\s-\sie,\swithout\nmaking\sxp\sthe\ssole\sTcl\scommand\sthat\sfails\sto\ssatisfy\sthe\nEndekalogue.\sThat\sis\sa\sno-no,\sand\sis\swhat\sDonal\swas\salluding\nto.\s"Skipping\sthe\sTcl\sparser"\sis\sbeyond\sthe\smeans\sof\sa\ncommand\s-\sthe\sparser\sdoes\sits\swork\sbefore\snoticing\swhat\sthe\ncommand\sis.\sThink\sof\swhat\sshould\shappen\sfor\seg\n\s\s\sset\scmd\sxp\n\s\s\sset\sa\s[$cmd\s$a*2]\nStart\sparsing/substituting,\sand\sstop\swhen\syou\snotice\sit\sis\nactually\sxp?\n\nYour\sexamples\swere\sall\styped\swithout\sspaces\s-\sie,\sit\sseems\nthat\syou\spropose\san\sxp\sthat\stakes\sa\ssingle\sargument.\sThe\nchoice\sis\seither\sthat\n\s\s\sset\sx\s[xp\s$a\s+\s$a\s*\s$b\s].0\nerrors\sout\s(after\sbeing\sparsed\sto\sdetermine\sthe\snumber\sof\narguments\sto\sxp),\sor\selse\sthe\sTcl\sparser\shas\sto\sget\sa\snew\nrule\sthat\ssays\s"if\sthe\scommand\sname\sis\sxp,\sthe\srest\sof\sthe\ncommand\swill\sbe\spassed\sas\sa\ssingle\sstring\sargument\sto\sxp";\nbut\syou\sstill\shave\sto\sparse\sto\slook\sfor\sthe\sclosing\s']'\s-\nso,\sno\sreal\ssavings.\n\nIn\ssummary:\sin\sorder\sto\swork\sas\sproposed,\sxp\swould\shave\sto\ndestroy\sTcl's\ssimplicity.\sAnd\sit\swould\sstill\sfail\sto\sbe\sas\nfast\sas\s\nexpr\s{...}.\n
J login msofer
J mimetype text/plain
J username msofer
K 1062849fffffffffffffffffffffffffffffffff
U msofer
Z 439ad26475215b634d7b5c889bdd9605