Error processing request

Parameters

CONTENT_LENGTH0
REQUEST_METHODGET
REQUEST_URI/revision/vwait?V=18
QUERY_STRINGV=18
CONTENT_TYPE
DOCUMENT_URI/revision/vwait
DOCUMENT_ROOT/var/www/nikit/nikit/nginx/../docroot
SCGI1
SERVER_PROTOCOLHTTP/1.1
HTTPSon
REMOTE_ADDR172.69.6.153
REMOTE_PORT51268
SERVER_PORT4443
SERVER_NAMEwiki.tcl-lang.org
HTTP_HOSTwiki.tcl-lang.org
HTTP_CONNECTIONKeep-Alive
HTTP_ACCEPT_ENCODINGgzip, br
HTTP_X_FORWARDED_FOR3.16.161.0
HTTP_CF_RAY88cc84fa3e3361bd-ORD
HTTP_X_FORWARDED_PROTOhttps
HTTP_CF_VISITOR{"scheme":"https"}
HTTP_ACCEPT*/*
HTTP_USER_AGENTMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])
HTTP_REFERERhttps://wiki.tcl.tk/revision/vwait?V=18
HTTP_CF_CONNECTING_IP3.16.161.0
HTTP_CDN_LOOPcloudflare
HTTP_CF_IPCOUNTRYUS

Body


Error

Unknow state transition: LINE -> END

-code

1

-level

0

-errorstack

INNER {returnImm {Unknow state transition: LINE -> END} {}} CALL {my render_wikit vwait vwait\ -\ Process\ events\ until\ a\ variable\ is\ written\n\nhttp://www.purl.org/tcl/home/man/tcl8.4/TclCmd/vwait.htm\n\n'''vwait'''\ ''varName''\n\nThis\ command\ enters\ the\ Tcl\ event\ loop\ to\ process\ events,\ blocking\ the\ application\ if\ no\ events\ are\ ready.\ \ It\ continues\ processing\ events\ until\ some\ event\ handler\ sets\ the\ value\ of\ variable\ ''varName''.\ \ Once\ ''varName''\ has\ been\ set,\ the\ '''vwait'''\ command\ will\ return\ as\ soon\ as\ the\ event\ handler\ that\ modified\ ''varName''\ completes.\ ''VarName''\ must\ globally\ scoped\ (either\ with\ a\ call\ to\ '''\[global\]'''\ for\ the\ ''varName'',\ or\ with\ the\ full\ namespace\ path\ specification).\n\ \ \ \[http://www.tcl.tk/man/tcl/TclCmd/vwait.htm%|%official\ man\ page\]:\ \ \ \nIn\ some\ cases\ the\ '''vwait'''\ command\ may\ not\ return\ immediately\ after\ ''varName''\ is\ set.\ This\ can\ happen\ if\ the\ event\ handler\ that\ sets\ ''varName''\ does\ not\ complete\ immediately.\ For\ example,\ if\ an\ event\ handler\ sets\ ''varName''\ and\ then\ itself\ calls\ '''vwait'''\ to\ wait\ for\ a\ different\ variable,\ then\ it\ may\ not\ return\ for\ a\ long\ time.\ During\ this\ time\ the\ top-level\ '''vwait'''\ is\ blocked\ waiting\ for\ the\ event\ handler\ to\ complete,\ so\ it\ cannot\ return\ either.\n\n----\n\n\[Chris\ Nelson\]\ said\ these\ golden\ words\ on\ \[the\ comp.lang.tcl\ newsgroup\]:\n\n''Multiple\ vwaits\ nest,\ they\ do\ not\ happen\ in\ parallel.\ \ The\ outermost\ vwait\ cannot\ complete\ until\ all\ others\ return.''\n\n----\n\n'''vwait\ forever''':\ ''Wish''\ has\ a\ built-in\ event\ loop.\ Tclsh\ has\ one\ too\ but\ enters\ that\ only\ on\ demand,\ for\ which\ the\ \[idiom\]\ is\ to\ write\ at\ the\ end\ of\ code\n\n\ vwait\ forever\n\n(''forever''\ being\ the\ name\ of\ a\ variable\ that\ is\ presumably\ never\ used,\ but\ you\ can\ set\ ''forever''\ to\ any\ value\ to\ terminate\ such\ a\ Tcl\ script).\ ''RS''\nSee\ the\ note\ below\ about\ namespaces\ -\ missing\ this\ note\ results\ in\ problems\ that\ occur\ quite\ commonly!\n(See\ the\ note\ below\ about\ namespaces\ -\ missing\ this\ note\ results\ in\ problems\ that\ occur\ quite\ commonly!)\n\n----\n\n'''Timeout\ for\ vwait''':\ Wai\ Shun\ Au\ wrote\ in\ \[the\ comp.lang.tcl\ newsgroup\]:\n\n\ after\ 30000\ \{set\ a\ \$a\}\n\ vwait\ a\n\n\n\[Jeffrey\ Hobbs\]\ commented:\ \ You\ found\ the\ standard\ way,\ but\ you\ have\ to\ go\ a\n\[Jeffrey\ Hobbs\]\ commented:\nYou\ found\ the\ standard\ way,\ but\ you\ have\ to\ go\ a\ bit\ further\ to\ avoid\ weird\ bugs.\ \ Cache\ the\ \[after\]\ id\ and\ make\ sure\ to\ cancel\ it\ following\ the\ ''vwait''\ (no\ \[catch\]\ needed\ -\ if\ the\ after\ id\ no\ longer\ exists,\ because\ it\ was\ triggered,\ ''after\ cancel''\ doesn't\ care).\ \ That\ way\ you\ won't\ get\ ''a''\ being\ reset\ no\ matter\ what\ in\ 30\ secs.\n----\n\n\[DKF\]:\ \ You\ can\ '''`vwait`\ on\ several\ variables\ simultaneously'''\ as\ long\ as\nYou\ can\ '''\[\[vwait\]\]\ on\ several\ variables\ simultaneously'''\ as\ long\ as\ all\ those\ variables\ are\ in\ the\ same\ array,\ and\ you\ are\ happy\ for\ any\ set\ of\ the\ array\ to\ cause\ the\ \[\[vwait\]\]\ to\ terminate.\ \ Do\ this\ by\ making\ the\ \[\[vwait\]\]\ be\ on\ the\ overall\ array,\ and\ not\ any\ element\ of\ it.\ \ ''\[DKF\]''\n----\n\n\[BBH\]:\ \ Actually,\ you\ can\ combine\ the\ multiple\ variable\ &\ timeout\ nicely\nActually,\ you\ can\ combine\ the\ multiple\ variable\ &\ timeout\ nicely\ without\ the\ variables\ having\ to\ be\ related,\ and\ the\ timer\ won't\ affect\ the\ actual\ variables,\ Demonstrated\ by\ this\ code\ taken\ from\ dissussion\ on\ \[the\ comp.lang.tcl\ newsgroup\]\ (most\ of\ the\ original\ work\ by\ \[Donald\ Porter\],\ that\ I\ tweaked\ a\ little\ to\ add\ timeout\ option).\ ''\[BBH\]''\nkenstir:\ \ I\ have\ further\ tweaked\ this\ version\ of\ waitForAny\ that\ returns\ the\nI\ have\ further\ tweaked\ this\ version\ of\ waitForAny\ that\ returns\ the\ var\ (or\ vars)\ that\ got\ set\ during\ the\ vwait.\ \ This\ allows\ you\ to\ build\ a\ robust\ asynchronous\ queue.\ \ I'm\ submitting\ it\ as\ a\ patch\ to\ tcllib.sourceforge.net\ along\ with\ tests.\ \ ''kenstir''\n\n\ namespace\ eval\ control\ \{\n\ \ \ \ variable\ waitForAnyKey\ 0\n\n\ \ \ \ #\ new\ \"vwait\"\ that\ takes\ multiple\ variables\ and/or\ optional\ timeout\n\ \ \ \ #\ usage:\ \ waitForAny\ ?timeout?\ variable\ ?variable\ ...?\n\ \ \ \ proc\ waitForAny\ \{args\}\ \{\n\ \ \ \ \ \ \ \ variable\ waitForAnyArray\n\ \ \ \ \ \ \ variable\ waitForAnyArray\n\ \ \ \ \ \ \ variable\ waitForAnyKey\n\ \ \ \ \ \ \ \ #\ if\ first\ arg\ is\ a\ number,\ then\ that\ is\ max\ wait\ time\n\ \ \ \ \ \ \ #\ if\ first\ arg\ is\ a\ number,\ then\ that\ is\ max\ wait\ time\n\ \ \ \ \ \ \ if\ \{\[string\ is\ int\ \[lindex\ \$args\ 0\]\]\}\ \{\n\ \ \ \ \ \ \ \ \ \ set\ timeout\ \[lindex\ \$args\ 0\]\n\ \ \ \ \ \ \ \ \ \ set\ args\ \[lrange\ \$args\ 1\ end\]\n\ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ #\ create\ trigger\ script\ that\ will\ cause\ vwait\ to\ fall\ thru\n\ \ \ \ \ \ \ #\ create\ trigger\ script\ that\ will\ cause\ vwait\ to\ fall\ thru\n\ \ \ \ \ \ \ #\ (trailing\ comment\ is\ to\ eat\ appended\ args\ in\ trace\ command)\n\ \ \ \ \ \ \ set\ index\ \"Key\[incr\ waitForAnyKey\]\"\n\ \ \ \ \ \ \ set\ trigger\ \"\[namespace\ code\ \[list\ set\ waitForAnyArray(\$index)\ 1\]\]\ \;#\"\n\ \ \ \ \ \ \ \ #\ create\ trace\ to\ trip\ trigger\n\ \ \ \ \ \ \ #\ create\ trace\ to\ trip\ trigger\n\ \ \ \ \ \ \ foreach\ var\ \$args\ \{\n\ \ \ \ \ \ \ \ \ \ uplevel\ \\#0\ \[list\ trace\ variable\ \$var\ w\ \$trigger\]\n\ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ #\ set\ timer\ is\ user\ requested\ one\n\ \ \ \ \ \ \ #\ set\ timer\ is\ user\ requested\ one\n\ \ \ \ \ \ \ if\ \{\[info\ exists\ timeout\]\}\ \{\n\ \ \ \ \ \ \ \ \ \ set\ timerId\ \[after\ \$timeout\ \$trigger\]\n\ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ vwait\ \[namespace\ which\ -variable\ waitForAnyArray\](\$index)\n\ \ \ \ \ \ \ \ #\ remove\ all\ traces\n\ \ \ \ \ \ \ #\ remove\ all\ traces\n\ \ \ \ \ \ \ foreach\ var\ \$args\ \{\n\ \ \ \ \ \ \ \ \ \ uplevel\ \\#0\ \[list\ trace\ vdelete\ \$var\ w\ \$trigger\]\n\ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ #\ cancel\ timer\n\ \ \ \ \ \ \ #\ cancel\ timer\n\ \ \ \ \ \ \ if\ \[info\ exists\ timerId\]\ \{\n\ \ \ \ \ \ \ \ \ \ after\ cancel\ \$timerId\n\ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ #\ cleanup\n\ \ \ \ \ \ \ unset\ waitForAnyArray(\$index)\n\}\n\ \}\n\n----\n\n'''vwait\ in\ namespaces:'''\ It\ is\ not\ documented,\ but\ the\ varName\ must\ be\ globally\ qualified\ as\ if\ in\ a\ binding,\ even\ if\ the\ vwait\ is\ inside\ a\ ''namespace\ eval'':\n\n\ namespace\ eval\ foo\ \{\n\ \ \ \ \ \ \ vwait\ bar\ \ \ \ \ \ \ \ \;#\ will\ never\ fire\n\ \ \ \ \ \ \ vwait\ ::foo::bar\ \;#\ does\ the\ job\n\ \ \ \ variable\ bar\ \ \ \ \ \;#\ These\ two\ lines\ also\ do\ the\ job\n\ \ \ \ \ \ \ variable\ bar\ \ \ \ \ \;#\ These\ two\ lines\ also\ do\ the\ job\n\ \ \ \ \ \ \ vwait\ \[namespace\ which\ -variable\ bar\]\ \ \ \ \;#\ DGP\n\ \}\ \;#\ RS\n\n'''\[DGP\]'''\ --\ The\ fully\ qualified\ name\ requirement\ is\ documented\ in\ Tcl\ 8.3.3.\ \ Upgrade!\n\n----\nA\ majority\ of\ the\ coding\ questions\ received\ in\ \[comp.lang.tcl\]\nA\ majority\ of\ the\ coding\ questions\ received\ in\ \[the\ comp.lang.tcl\ newsgroup\]\ about\ vwait\ appear\ to\ result\ from\ deep\ misunderstandings\ of\ the\ command\ (as\ opposed\ to\ mere\ syntactic\ confusion,\ for\ example).\ \[Bruce\ Hartweg\]\ has\ rightly\ advised\ that\ its\ proper\ use\ is\ restricted:\ \ \"IMHO\ vwaits\ shouldn't\ be\ used\ too\ much\ (the\ nesting\ issue\ creates\ unexpected\ results)\ because\ you\ are\ trying\ to\ force\ a\ synchronous\ approach\nin\ an\ event\ world\ -\ It\ is\ much\ better\ to\ keep\ everything\ event\ driven.\ Occasionally\ for\ simple\ things\ (like\ dialogs)\ to\ use\ a\ vwait\ to\ avoid\ having\ to\ break\ something\ the\ has\ a\ couple\ of\ file\ picks\ and/or\ confirmations\ into\ umpteen\ parts\ has\ its\ place.\"\ \ \[KBK\]\ agrees\ that\ the\ \[Tcl\ event\ loop\]\ is\ widely\ misunderstood\ and\ discusses\ related\ issues\ in\ \[Update\ considered\ harmful\]\ and\ the\ pages\ to\ which\ it\ links.\nin\ an\ event\ world,\ it\ is\ much\ better\ to\ keep\ everything\ event\ driven.\n\nPackages\ such\ as\ \[Tk\]\ and\ \[tclsvc\]\ themselves\ call\ `vwait`.\ \ To\ avoid\ nested\ `vwait`\ calls:\nThis\ little\ program\ demonstrates\ what\ \[Chris\ Nelson\]\ stated\ above\ (vwaits\ nest):\n\n\ set\ ::time\ 0\n\ set\ ::a\ 0\n\ set\ ::b\ 0\nproc\ a_vwait\ \{\}\ \{\n\ proc\ a_vwait\ \{\ \}\ \{\n\ \ \ \ \ puts\ \"Waiting\ 15\ sec\ for\ ::a\"\n\ \ \ \ \ vwait\ ::a\n\ \ \ \ \ puts\ \"::a\ set\"\n\ \}\nproc\ b_vwait\ \{\}\ \{\n\ proc\ b_vwait\ \{\ \}\ \{\n\ \ \ \ \ puts\ \"Waiting\ 30\ sec\ for\ ::b\"\n\ \ \ \ \ vwait\ ::b\n\ \ \ \ \ puts\ \"::b\ set\"\n\ \}\n\nproc\ timer\ \{\}\ \{\n\ proc\ timer\ \{\ \}\ \{\n\ \ \ \ \ incr\ ::time\ 1\n\ \ \ \ \ puts\ \"\$::time\ sec\"\n\ \ \ \ \ if\ \{\$::time\ ==\ 35\}\ \{\n\ \ \ \ \ \ \ \ \ exit\ \n\ \ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ \ after\ 1000\ timer\n\ \ \ \ \ \}\n\ \}\nafter\ 1\ a_vwait\n\n\ after\ 1\ a_vwait\n\ after\ 5\ b_vwait\n\ after\ 10\ timer\nafter\ 15000\ \{set\ ::a\ 0\}\n\n\ after\ 15000\ \{set\ ::a\ 0\}\n\ after\ 30000\ \{set\ ::b\ 0\}\nvwait\ forever\n\ vwait\ forever\n\n\nWhen\ you\ understand\ this\ code\ snippit,\ you'll\ be\ free\ from\ the\ dangers\ of\ haphazardly\ using\ vwait.\n\n----\n\[Marty\ Backe\]\n15\ August\ 2002\nPeter\ Newman\ 2004-03-09:\ '''Wish\ Is\ Buggy!'''\ It\ seems\ to\ me\ that\ all\ these\n----\n======\n''\[Jeff\ Hobbs\]\ spoke\ in\ the\ \[Tcl\ chatroom\]:''\ vwait\ should\ always\ be\ protected\ by\n\n\ \ if\ \{!\[info\ exists\ tk_version\]\ &&\ !\[info\ exists\ tcl_service\]\}\ \{\ ...\n\nWhy?\ \ \[CL\]\ says\ it's\ to\ avoid\ the\ lockup\ of\ duelling\ vwaits--'cause\ \[Tk\]\ and\ \[tclsvc\]\ launch\ their\ own.\n\n\n\[schlenk\]:\ \ Not\ really,\ wish\ is\ ok,\ but\ there\ are\ tendencies\ to\ get\ rid\ of\ it\n\[Tcl\ syntax\ help\]\ -\n\[Arts\ and\ Crafts\ of\ Tcl-Tk\ Programming\]\ -\n\[Category\ Command\] regexp2} CALL {my render vwait vwait\ -\ Process\ events\ until\ a\ variable\ is\ written\n\nhttp://www.purl.org/tcl/home/man/tcl8.4/TclCmd/vwait.htm\n\n'''vwait'''\ ''varName''\n\nThis\ command\ enters\ the\ Tcl\ event\ loop\ to\ process\ events,\ blocking\ the\ application\ if\ no\ events\ are\ ready.\ \ It\ continues\ processing\ events\ until\ some\ event\ handler\ sets\ the\ value\ of\ variable\ ''varName''.\ \ Once\ ''varName''\ has\ been\ set,\ the\ '''vwait'''\ command\ will\ return\ as\ soon\ as\ the\ event\ handler\ that\ modified\ ''varName''\ completes.\ ''VarName''\ must\ globally\ scoped\ (either\ with\ a\ call\ to\ '''\[global\]'''\ for\ the\ ''varName'',\ or\ with\ the\ full\ namespace\ path\ specification).\n\ \ \ \[http://www.tcl.tk/man/tcl/TclCmd/vwait.htm%|%official\ man\ page\]:\ \ \ \nIn\ some\ cases\ the\ '''vwait'''\ command\ may\ not\ return\ immediately\ after\ ''varName''\ is\ set.\ This\ can\ happen\ if\ the\ event\ handler\ that\ sets\ ''varName''\ does\ not\ complete\ immediately.\ For\ example,\ if\ an\ event\ handler\ sets\ ''varName''\ and\ then\ itself\ calls\ '''vwait'''\ to\ wait\ for\ a\ different\ variable,\ then\ it\ may\ not\ return\ for\ a\ long\ time.\ During\ this\ time\ the\ top-level\ '''vwait'''\ is\ blocked\ waiting\ for\ the\ event\ handler\ to\ complete,\ so\ it\ cannot\ return\ either.\n\n----\n\n\[Chris\ Nelson\]\ said\ these\ golden\ words\ on\ \[the\ comp.lang.tcl\ newsgroup\]:\n\n''Multiple\ vwaits\ nest,\ they\ do\ not\ happen\ in\ parallel.\ \ The\ outermost\ vwait\ cannot\ complete\ until\ all\ others\ return.''\n\n----\n\n'''vwait\ forever''':\ ''Wish''\ has\ a\ built-in\ event\ loop.\ Tclsh\ has\ one\ too\ but\ enters\ that\ only\ on\ demand,\ for\ which\ the\ \[idiom\]\ is\ to\ write\ at\ the\ end\ of\ code\n\n\ vwait\ forever\n\n(''forever''\ being\ the\ name\ of\ a\ variable\ that\ is\ presumably\ never\ used,\ but\ you\ can\ set\ ''forever''\ to\ any\ value\ to\ terminate\ such\ a\ Tcl\ script).\ ''RS''\nSee\ the\ note\ below\ about\ namespaces\ -\ missing\ this\ note\ results\ in\ problems\ that\ occur\ quite\ commonly!\n(See\ the\ note\ below\ about\ namespaces\ -\ missing\ this\ note\ results\ in\ problems\ that\ occur\ quite\ commonly!)\n\n----\n\n'''Timeout\ for\ vwait''':\ Wai\ Shun\ Au\ wrote\ in\ \[the\ comp.lang.tcl\ newsgroup\]:\n\n\ after\ 30000\ \{set\ a\ \$a\}\n\ vwait\ a\n\n\n\[Jeffrey\ Hobbs\]\ commented:\ \ You\ found\ the\ standard\ way,\ but\ you\ have\ to\ go\ a\n\[Jeffrey\ Hobbs\]\ commented:\nYou\ found\ the\ standard\ way,\ but\ you\ have\ to\ go\ a\ bit\ further\ to\ avoid\ weird\ bugs.\ \ Cache\ the\ \[after\]\ id\ and\ make\ sure\ to\ cancel\ it\ following\ the\ ''vwait''\ (no\ \[catch\]\ needed\ -\ if\ the\ after\ id\ no\ longer\ exists,\ because\ it\ was\ triggered,\ ''after\ cancel''\ doesn't\ care).\ \ That\ way\ you\ won't\ get\ ''a''\ being\ reset\ no\ matter\ what\ in\ 30\ secs.\n----\n\n\[DKF\]:\ \ You\ can\ '''`vwait`\ on\ several\ variables\ simultaneously'''\ as\ long\ as\nYou\ can\ '''\[\[vwait\]\]\ on\ several\ variables\ simultaneously'''\ as\ long\ as\ all\ those\ variables\ are\ in\ the\ same\ array,\ and\ you\ are\ happy\ for\ any\ set\ of\ the\ array\ to\ cause\ the\ \[\[vwait\]\]\ to\ terminate.\ \ Do\ this\ by\ making\ the\ \[\[vwait\]\]\ be\ on\ the\ overall\ array,\ and\ not\ any\ element\ of\ it.\ \ ''\[DKF\]''\n----\n\n\[BBH\]:\ \ Actually,\ you\ can\ combine\ the\ multiple\ variable\ &\ timeout\ nicely\nActually,\ you\ can\ combine\ the\ multiple\ variable\ &\ timeout\ nicely\ without\ the\ variables\ having\ to\ be\ related,\ and\ the\ timer\ won't\ affect\ the\ actual\ variables,\ Demonstrated\ by\ this\ code\ taken\ from\ dissussion\ on\ \[the\ comp.lang.tcl\ newsgroup\]\ (most\ of\ the\ original\ work\ by\ \[Donald\ Porter\],\ that\ I\ tweaked\ a\ little\ to\ add\ timeout\ option).\ ''\[BBH\]''\nkenstir:\ \ I\ have\ further\ tweaked\ this\ version\ of\ waitForAny\ that\ returns\ the\nI\ have\ further\ tweaked\ this\ version\ of\ waitForAny\ that\ returns\ the\ var\ (or\ vars)\ that\ got\ set\ during\ the\ vwait.\ \ This\ allows\ you\ to\ build\ a\ robust\ asynchronous\ queue.\ \ I'm\ submitting\ it\ as\ a\ patch\ to\ tcllib.sourceforge.net\ along\ with\ tests.\ \ ''kenstir''\n\n\ namespace\ eval\ control\ \{\n\ \ \ \ variable\ waitForAnyKey\ 0\n\n\ \ \ \ #\ new\ \"vwait\"\ that\ takes\ multiple\ variables\ and/or\ optional\ timeout\n\ \ \ \ #\ usage:\ \ waitForAny\ ?timeout?\ variable\ ?variable\ ...?\n\ \ \ \ proc\ waitForAny\ \{args\}\ \{\n\ \ \ \ \ \ \ \ variable\ waitForAnyArray\n\ \ \ \ \ \ \ variable\ waitForAnyArray\n\ \ \ \ \ \ \ variable\ waitForAnyKey\n\ \ \ \ \ \ \ \ #\ if\ first\ arg\ is\ a\ number,\ then\ that\ is\ max\ wait\ time\n\ \ \ \ \ \ \ #\ if\ first\ arg\ is\ a\ number,\ then\ that\ is\ max\ wait\ time\n\ \ \ \ \ \ \ if\ \{\[string\ is\ int\ \[lindex\ \$args\ 0\]\]\}\ \{\n\ \ \ \ \ \ \ \ \ \ set\ timeout\ \[lindex\ \$args\ 0\]\n\ \ \ \ \ \ \ \ \ \ set\ args\ \[lrange\ \$args\ 1\ end\]\n\ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ #\ create\ trigger\ script\ that\ will\ cause\ vwait\ to\ fall\ thru\n\ \ \ \ \ \ \ #\ create\ trigger\ script\ that\ will\ cause\ vwait\ to\ fall\ thru\n\ \ \ \ \ \ \ #\ (trailing\ comment\ is\ to\ eat\ appended\ args\ in\ trace\ command)\n\ \ \ \ \ \ \ set\ index\ \"Key\[incr\ waitForAnyKey\]\"\n\ \ \ \ \ \ \ set\ trigger\ \"\[namespace\ code\ \[list\ set\ waitForAnyArray(\$index)\ 1\]\]\ \;#\"\n\ \ \ \ \ \ \ \ #\ create\ trace\ to\ trip\ trigger\n\ \ \ \ \ \ \ #\ create\ trace\ to\ trip\ trigger\n\ \ \ \ \ \ \ foreach\ var\ \$args\ \{\n\ \ \ \ \ \ \ \ \ \ uplevel\ \\#0\ \[list\ trace\ variable\ \$var\ w\ \$trigger\]\n\ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ #\ set\ timer\ is\ user\ requested\ one\n\ \ \ \ \ \ \ #\ set\ timer\ is\ user\ requested\ one\n\ \ \ \ \ \ \ if\ \{\[info\ exists\ timeout\]\}\ \{\n\ \ \ \ \ \ \ \ \ \ set\ timerId\ \[after\ \$timeout\ \$trigger\]\n\ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ vwait\ \[namespace\ which\ -variable\ waitForAnyArray\](\$index)\n\ \ \ \ \ \ \ \ #\ remove\ all\ traces\n\ \ \ \ \ \ \ #\ remove\ all\ traces\n\ \ \ \ \ \ \ foreach\ var\ \$args\ \{\n\ \ \ \ \ \ \ \ \ \ uplevel\ \\#0\ \[list\ trace\ vdelete\ \$var\ w\ \$trigger\]\n\ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ #\ cancel\ timer\n\ \ \ \ \ \ \ #\ cancel\ timer\n\ \ \ \ \ \ \ if\ \[info\ exists\ timerId\]\ \{\n\ \ \ \ \ \ \ \ \ \ after\ cancel\ \$timerId\n\ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ #\ cleanup\n\ \ \ \ \ \ \ unset\ waitForAnyArray(\$index)\n\}\n\ \}\n\n----\n\n'''vwait\ in\ namespaces:'''\ It\ is\ not\ documented,\ but\ the\ varName\ must\ be\ globally\ qualified\ as\ if\ in\ a\ binding,\ even\ if\ the\ vwait\ is\ inside\ a\ ''namespace\ eval'':\n\n\ namespace\ eval\ foo\ \{\n\ \ \ \ \ \ \ vwait\ bar\ \ \ \ \ \ \ \ \;#\ will\ never\ fire\n\ \ \ \ \ \ \ vwait\ ::foo::bar\ \;#\ does\ the\ job\n\ \ \ \ variable\ bar\ \ \ \ \ \;#\ These\ two\ lines\ also\ do\ the\ job\n\ \ \ \ \ \ \ variable\ bar\ \ \ \ \ \;#\ These\ two\ lines\ also\ do\ the\ job\n\ \ \ \ \ \ \ vwait\ \[namespace\ which\ -variable\ bar\]\ \ \ \ \;#\ DGP\n\ \}\ \;#\ RS\n\n'''\[DGP\]'''\ --\ The\ fully\ qualified\ name\ requirement\ is\ documented\ in\ Tcl\ 8.3.3.\ \ Upgrade!\n\n----\nA\ majority\ of\ the\ coding\ questions\ received\ in\ \[comp.lang.tcl\]\nA\ majority\ of\ the\ coding\ questions\ received\ in\ \[the\ comp.lang.tcl\ newsgroup\]\ about\ vwait\ appear\ to\ result\ from\ deep\ misunderstandings\ of\ the\ command\ (as\ opposed\ to\ mere\ syntactic\ confusion,\ for\ example).\ \[Bruce\ Hartweg\]\ has\ rightly\ advised\ that\ its\ proper\ use\ is\ restricted:\ \ \"IMHO\ vwaits\ shouldn't\ be\ used\ too\ much\ (the\ nesting\ issue\ creates\ unexpected\ results)\ because\ you\ are\ trying\ to\ force\ a\ synchronous\ approach\nin\ an\ event\ world\ -\ It\ is\ much\ better\ to\ keep\ everything\ event\ driven.\ Occasionally\ for\ simple\ things\ (like\ dialogs)\ to\ use\ a\ vwait\ to\ avoid\ having\ to\ break\ something\ the\ has\ a\ couple\ of\ file\ picks\ and/or\ confirmations\ into\ umpteen\ parts\ has\ its\ place.\"\ \ \[KBK\]\ agrees\ that\ the\ \[Tcl\ event\ loop\]\ is\ widely\ misunderstood\ and\ discusses\ related\ issues\ in\ \[Update\ considered\ harmful\]\ and\ the\ pages\ to\ which\ it\ links.\nin\ an\ event\ world,\ it\ is\ much\ better\ to\ keep\ everything\ event\ driven.\n\nPackages\ such\ as\ \[Tk\]\ and\ \[tclsvc\]\ themselves\ call\ `vwait`.\ \ To\ avoid\ nested\ `vwait`\ calls:\nThis\ little\ program\ demonstrates\ what\ \[Chris\ Nelson\]\ stated\ above\ (vwaits\ nest):\n\n\ set\ ::time\ 0\n\ set\ ::a\ 0\n\ set\ ::b\ 0\nproc\ a_vwait\ \{\}\ \{\n\ proc\ a_vwait\ \{\ \}\ \{\n\ \ \ \ \ puts\ \"Waiting\ 15\ sec\ for\ ::a\"\n\ \ \ \ \ vwait\ ::a\n\ \ \ \ \ puts\ \"::a\ set\"\n\ \}\nproc\ b_vwait\ \{\}\ \{\n\ proc\ b_vwait\ \{\ \}\ \{\n\ \ \ \ \ puts\ \"Waiting\ 30\ sec\ for\ ::b\"\n\ \ \ \ \ vwait\ ::b\n\ \ \ \ \ puts\ \"::b\ set\"\n\ \}\n\nproc\ timer\ \{\}\ \{\n\ proc\ timer\ \{\ \}\ \{\n\ \ \ \ \ incr\ ::time\ 1\n\ \ \ \ \ puts\ \"\$::time\ sec\"\n\ \ \ \ \ if\ \{\$::time\ ==\ 35\}\ \{\n\ \ \ \ \ \ \ \ \ exit\ \n\ \ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ \ after\ 1000\ timer\n\ \ \ \ \ \}\n\ \}\nafter\ 1\ a_vwait\n\n\ after\ 1\ a_vwait\n\ after\ 5\ b_vwait\n\ after\ 10\ timer\nafter\ 15000\ \{set\ ::a\ 0\}\n\n\ after\ 15000\ \{set\ ::a\ 0\}\n\ after\ 30000\ \{set\ ::b\ 0\}\nvwait\ forever\n\ vwait\ forever\n\n\nWhen\ you\ understand\ this\ code\ snippit,\ you'll\ be\ free\ from\ the\ dangers\ of\ haphazardly\ using\ vwait.\n\n----\n\[Marty\ Backe\]\n15\ August\ 2002\nPeter\ Newman\ 2004-03-09:\ '''Wish\ Is\ Buggy!'''\ It\ seems\ to\ me\ that\ all\ these\n----\n======\n''\[Jeff\ Hobbs\]\ spoke\ in\ the\ \[Tcl\ chatroom\]:''\ vwait\ should\ always\ be\ protected\ by\n\n\ \ if\ \{!\[info\ exists\ tk_version\]\ &&\ !\[info\ exists\ tcl_service\]\}\ \{\ ...\n\nWhy?\ \ \[CL\]\ says\ it's\ to\ avoid\ the\ lockup\ of\ duelling\ vwaits--'cause\ \[Tk\]\ and\ \[tclsvc\]\ launch\ their\ own.\n\n\n\[schlenk\]:\ \ Not\ really,\ wish\ is\ ok,\ but\ there\ are\ tendencies\ to\ get\ rid\ of\ it\n\[Tcl\ syntax\ help\]\ -\n\[Arts\ and\ Crafts\ of\ Tcl-Tk\ Programming\]\ -\n\[Category\ Command\]} CALL {my revision vwait} CALL {::oo::Obj82614 process revision/vwait} CALL {::oo::Obj82612 process}

-errorcode

NONE

-errorinfo

Unknow state transition: LINE -> END
    while executing
"error $msg"
    (class "::Wiki" method "render_wikit" line 6)
    invoked from within
"my render_$default_markup $N $C $mkup_rendering_engine"
    (class "::Wiki" method "render" line 8)
    invoked from within
"my render $name $C"
    (class "::Wiki" method "revision" line 31)
    invoked from within
"my revision $page"
    (class "::Wiki" method "process" line 56)
    invoked from within
"$server process [string trim $uri /]"

-errorline

4