Skip to content
Tcl Source Code Artifact [c1d5cbd21e]
Login

Artifact [c1d5cbd21e]

Artifact c1d5cbd21ebaab2828449531540998f9a394a068:

Ticket change [c1d5cbd21e] - Ticket [2314561fffffffff|2314561fff] <i>TODO: NRE-enable [subst]</i> status still Open with 4 other changes by dkf on 2009-07-18 20:58:55.
D 2009-07-18T20:58:55
J icomment A\sbit\sdeeper\sexplanation\sabout\swhy\sthis\smatters.\n\nTclhttpd\sis\sused\sa\sfair\sbit\sto\shandle\scustom\sapplication-on-the-www\sscenarios,\sand\sthe\smost\scommon\sway\sof\susing\sit\sthat\sway\sis\sto\swrite\sthe\spages\sin\sTMML,\swhich\sinvolves\sthe\suse\sof\s[subst].\sSomething\sthat's\soften\sdesired\sis\sa\sway\sto\sstop\sthe\sprocessing\sof\sa\spage\sfor\sa\swhile\suntil\ssome\sother\sprocessing\s(e.g.,\srunning\sa\ssubprocess)\sis\sfinished;\sright\snow,\swith\stclhttpd\sthey're\sdoing\sthis\sby\susing\s[vwait]\srecursively\s(inside\sanother\sprocedure\scall).\sIf\swe\scould\s[yield]\sduring\s[subst]-processing,\sthen\sit\swould\sbe\spossible\sto\schange\sthe\stemplate\sprocessing\slibrary\sso\sthat\stclhttpd/tmml\sdoesn't\shave\sthis\snasty\srecursive-vwait\scase\swithout\shaving\sto\srewrite\slots\sof\sexisting\spages\sthat\sare\salready\sin\sproduction.\n\nI've\sthought\sa\sbit\sabout\swhat\sit\swould\stake\sto\smake\s[subst]\smore\sefficient\sin\sthe\spast.\sPossibilities\sincluded\sdirectly\sbytecoding\sit,\sbut\salmost\sall\ssubstantive\s(and\sinteresting)\scases\suse\sa\snon-constant\stemplate.\sHence\sit's\sprobably\sgood\senough\sto\sconvert\sthe\stemplate\sto\ssomething\swith\san\sinternal\srep\sthat\shas\sthree\ssub-components:\sordinary\sstring,\svariable\ssubstitution,\scommand\ssubstitution\s(all\smodulo\sthe\soptions).\sIt\swould\sthen\sbe\spossible\sto\sjust\sconcatenate\sthese\sbits\sappropriately\s(and\squickly)\sto\smake\sthe\sresult,\sand\sdoing\sso\sin\san\sNRE-aware\sway\swould\sbe\sstraight-forward\stoo\s(only\saffects\scommand\ssubstitutions\sas\svar\straces\saren't\sNRE-aware).\n\nThe\sparser\sis\ssufficiently\scomplex\sthat\sthe\sconversion\sto\sthe\sabove-mentioned\ssequence\sform\sis\sbeyond\swhat\sI\scan\sdo\sin\sa\ssmall\samount\sof\seffort,\shence\sdropping\sit\son\syour\slap,\sDon.\s:-)\n
J login dkf
J mimetype text/plain
J username dkf
K 2314561fffffffffffffffffffffffffffffffff
U dkf
Z 8ae033deff5195c40df79178d47abd9c