Error processing request

Parameters

CONTENT_LENGTH0
REQUEST_METHODGET
REQUEST_URI/revision/namespace?V=103
QUERY_STRINGV=103
CONTENT_TYPE
DOCUMENT_URI/revision/namespace
DOCUMENT_ROOT/var/www/nikit/nikit/nginx/../docroot
SCGI1
SERVER_PROTOCOLHTTP/1.1
HTTPSon
REMOTE_ADDR172.70.100.88
REMOTE_PORT18090
SERVER_PORT4443
SERVER_NAMEwiki.tcl-lang.org
HTTP_HOSTwiki.tcl-lang.org
HTTP_CONNECTIONKeep-Alive
HTTP_ACCEPT_ENCODINGgzip, br
HTTP_X_FORWARDED_FOR3.143.9.223
HTTP_CF_RAY88e9c0169d2ae1eb-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://nikit.tcl-lang.org/revision/namespace?V=103
HTTP_CF_CONNECTING_IP3.143.9.223
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 namespace '''\[http://www.tcl.tk/man/tcl/TclCmd/namespace.htm%|%namespace\]'''\ is\ a\ \[Tcl\ Commands%|%built-in\]\ \[namespace\ ensemble%|%ensemble\]\ of\ \[command%|%commands\]\ for\ working\ with\nnamespaces.\n\n\n\n**\ Synopsis\ **\n\n\ \ \ \ :\ \ \ '''\[namespace\ children\]'''\ ''?namespace?\ ?pattern?''\n\n\ \ \ \ :\ \ \ '''\[namespace\ code\]'''\ ''script''\n\n\ \ \ \ :\ \ \ '''\[namespace\ current\]'''\n\n\ \ \ \ :\ \ \ '''\[namespace\ delete\]'''\ ''?namespace\ namespace\ ...?''\n\n\ \ \ \ :\ \ \ '''\[namespace\ ensemble\]'''\ ''option\ ?arg\ ...?''\n\n\ \ \ \ :\ \ \ '''\[namespace\ eval\]'''\ ''namespace\ arg\ ?arg\ ...?''\n\n\ \ \ \ :\ \ \ '''\[namespace\ exists\]'''\ ''namespace''\n\n\ \ \ \ :\ \ \ '''\[namespace\ export\]'''\ ''?-'''''clear'''''?\ ?pattern\ pattern\ ...?''\n\n\ \ \ \ :\ \ \ '''\[namespace\ forget\]'''\ ''?pattern\ pattern\ ...?''\n\n\ \ \ \ :\ \ \ '''\[namespace\ import\]'''\ ''?-'''''force'''''?\ ?pattern\ pattern\ ...?''\n\n\ \ \ \ :\ \ \ '''\[namespace\ inscope\]'''\ ''namespace\ script\ ?arg\ ...?''\n\n\ \ \ \ :\ \ \ '''\[namespace\ origin\]'''\ ''command''\n\n\ \ \ \ :\ \ \ '''\[namespace\ parent\]'''\ ''?namespace?''\n\n\ \ \ \ :\ \ \ '''\[namespace\ path\]'''\ ''?namespaceList?''\n\n\ \ \ \ :\ \ \ '''\[namespace\ qualifiers\]'''\ ''string''\n\n\ \ \ \ :\ \ \ '''\[namespace\ tail\]'''\ ''string''\n\n\ \ \ \ :\ \ \ '''\[namespace\ upvar\]'''\ ''namespace\ otherVar\ myVar\ ?otherVar\ myVar\ ...?''\n\n\ \ \ \ :\ \ \ '''\[namespace\ unknown\]'''\ ''?script?''\n\n\ \ \ \ :\ \ \ '''\[namespace\ which\]'''\ ''?-'''''command'''''?\ ?-'''''variable'''''?\ name''\n\n\n\n**\ See\ Also\ **\n\n\ \ \ \[::\]:\ \ \ the\ namespace\ delimiter\n\n\ \ \ \[ns\],\ by\ \[stu\]:\ \ \ an\ additional\ set\ of\ commands\ for\ working\ with\ namespaces\ \n\n\ \ \ \[namespace\ size\]:\ \ \ \n\n\ \ \ \[Thoughts\ on\ Namespaces\ and\ OO\]:\ \ \ \n\n\ \ \ \[Namespace\ variables\ 2\]:\ \ \ \n\n\ \ \ \[Namespace\ resolution\ of\ Variables\ &\ Procedures\]:\ \ \ \n\n\ \ \ \[data\ is\ code\]:\ \ \ \n\n\ \ \ \[_namespace\ import_\ and\ _rename_\]:\ \ \ describes\ the\ extraordinary\ freedom\ won\ through\ the\ use\ of\ namespaces.\n\n\ \ \ \[closure%|%closures\]:\ \ \ Used\ in\ other\ languages\ to\ do\ what\ is\ done\ in\ Tcl\ using\ namespaces.\n\n\n\n\ \ \ \[http://www.tcl.tk/man/tcl/TclCmd/namespace.htm%|%official\ reference\ documentation\]:\ \ \ \n\n\ \ \ \[http://www.wjduquette.com/tcl/namespaces.html%|%Namespaces\ and\ Packages\],\ by\ \[William\ Duquette\]:\ \ \ \ \n\n\ \ \ \[http://www.rpbourret.com/xml/NamespacesFAQ.htm%|%XML\ Namespaces\ FAQ\]:\ \ \ valuable\ background\ information\ on\ the\ general\ use\ of\ namespaces\ in\ computing\n\n\ \ \ \[http://www.intertwingly.net/stories/2002/09/09/gentleIntroductionToNamespaces.html%|%A\ Gentle\ Introduction\ to\ Namespaces\],\ by\ \[Sam\ Ruby\]\ 2002:\ \ \ an\ \[XML\]-focused\ description\n\n\n\n**\ \ Proposals\ **\n\nEach\ namespace\ is\ actually\ three\ separate\ namespaces:\ One\ for\nAlthough\ namespaces\ and\ commands\ can\ have\ identical\ names,\ those\ names\ refer\ to\ndifferent\ things,\ even\ when\ a\ command\ is\ a\ namespace\ ensemble\ command\ for\ a\nnamespace\ having\ the\ same\ name\ as\ the\ command.\ \ Now\ try\ to\ say\ that\ last\nsentence\ 10\ times\ quickly.\ \n======\nnamespace\ which\ -variable\ ::one::two::three::four\ \;#\ ->\ ::one::two::three::four\n\n\nCan\ someone\ discuss\ how\ a\ Tcl\ script\ can\ determine:\n\n\ \ \ *\ what\ namespaces\ are\ available\ at\ any\ particular\ point\ in\ time\ \n\ \ \ *\ what\ procs\ and\ variables\ available\ in\ any\ one\ of\ these\ namespaces\n\nA\ simple\ `\[proc\]`\ to\ list\ all\ child\ namespaces,\ recursively:\n\n======\nproc\ listns\ \{\{parentns\ ::\}\}\ \{\n\ \ \ \ foreach\ ns\ \[namespace\ children\ \$parentns\]\ \{\n\ \ \ \ \ \ \ \ eval\ lappend\ result\ \[listns\ \$ns\]\n\ \ \ \ \ \ \ \ lappend\ result\ \$ns\n\ \ \ \ \}\n\ \ \ \ return\ \$result\n\}\n======\n\noutput:\n\n======\n%\ namespace\ eval\ ::test\ \{set\ foo\ 1\}\n1\n\n%\ namespace\ eval\ ::test2\ \{set\ foo\ 1\}\n1\n\n%\ namespace\ eval\ ::test::test3\ \{set\ foo\ 1\}\n1\n\n%\ listns\n::test::test3\ ::test\ ::test2\ ::tcl\n======\n\nFrom\ 8.5\ onwards,\ use\ this\ instead:\n\n======\nproc\ listns\ \{\{parentns\ ::\}\}\ \{\n\ \ \ \ set\ result\ \[list\]\n\ \ \ \ foreach\ ns\ \[namespace\ children\ \$parentns\]\ \{\n\ \ \ \ \ \ \ \ lappend\ result\ \{*\}\[listns\ \$ns\]\ \$ns\n\ \ \ \ \}\n\ \ \ \ return\ \$result\n\}\n======\n\n\nlist\ the\ variables\ in\ a\ namespace:\n\n======\nproc\ listnsvars\ \{\{ns\ ::\}\}\ \{\n\ \ \ \ return\ \[info\ vars\ \$\{ns\}::*\]\n\}\n======\n\nlist\ the\ procs\ in\ a\ namespace:\n\n======\nproc\ listnsprocs\ \{\{ns\ ::\}\}\ \{\n\ \ \ \ return\ \[info\ procs\ \$\{ns\}::*\]\n\}\n======\n\nlist\ the\ commands\ in\ a\ namespace:\n\n======\nproc\ listnscommands\ \{\{ns\ ::\}\}\ \{\n\ \ \ \ return\ \[info\ commands\ \$\{ns\}::*\]\n\}\n======\n\nThe\ previous\ examples\ only\ work\ well\ with\ fully\ qualified\ namespace\ names.\n\nBeware\ that\ in\ some\ apps\ these\ may\ take\ a\ long\ time\ to\ complete\ (for\ example,\nif\ there\ are\ hundreds\ of\ thousands\ of\ commands\ in\ ::).\n\n\n**\ Avoiding\ `\[variable\]`\ declarations\ in\ `\[proc\]`edures\ **\n\nchild\ namespace\ to\ be\ convenient.\ \ Instead\ of:\nchild\ namespace\ to\ be\ very\ convenient.\ \ Instead\ of:\n======\nnamespace\ eval\ TO\ \{\n\ \ \ \ variable\ foo\n\ \ \ \ proc\ proc1\ \{\}\ \{\n\ \ \ \ \ \ \ \ variable\ foo\n\ \ \ \ \ \ \ \ ...\ use\ \$foo\ ...\n\ \ \ \ \}\n\}\n======\n\nConsider\ using:\n\n======\nnamespace\ eval\ TO\ \{\n\ \ \ \ namespace\ eval\ v\ \{\n\ \ \ \ \ \ \ \ variable\ foo\n\ \ \ \ \}\n\ \ \ \ proc\ proc1\ \{\}\ \{\n\ \ \ \ \ \ \ \ ...\ use\ \$v::foo\ ...\n\ \ \ \ \}\n\}\n======\n\nNo\ more\ lists\ of\ `\[variable\]`\ calls\ inside\ each\ proc.\ \ The\ other\ way\ is\ to\ put\nall\ your\ variables\ inside\ a\ single\ `\[array\]`,\ but\ my\ impression\ is\ that\ the\ `v::*`\napproach\ is\ slightly\ faster\ (`\[variable\]`\ seems\ to\ take\ a\ bit\ of\ time,\ don't\ know\nwhy).\n\n\n\n**\ Procedure\ Resolution\ **\n\nWhen\ referring\ to\ a\ variable\ or\ a\ `\[proc\]`\ in\ a\ namespace\ embedded\ in\ other\nnamespaces,\ Tcl\ first\ searches\ the\ current\ namespace\ and\ then\ the\ \[global\]\nnamespace\ (as\ documented)\ and\ '''doesn't\ look\ in\ any\ intervening\ embedding\nnamespaces''':\n\n======\nproc\ ::p\ \{\}\ \{puts\ \{I'm\ ::p\}\}\nnamespace\ eval\ ns\ \{\n\ \ \ \ proc\ p\ \{\}\ \{puts\ \{I'm\ ns::p\}\}\n\ \ \ \ namespace\ eval\ child\ \{\n\ \ \ \ \ \ \ \ p\n\ \ \ \ \}\n\}\n======\n\nResult:\n\n======none\nI'm\ ::p\n======\n\nTcl\ resolved\ the\ name\ in\ the\ \[global\]\ namespace\ and\ didn't\ search\ in\ the\nintervening\ `ns`\ namespace.\n\nThis\ behaviour\ can\ be\ modified\ via\ `\[namespace\ path\]`.\n\n----\n\n\[LVwikignoming\]\ 2010-07-01\ 13:03:52:\n\nA\ recent\ email\ on\ the\ TCLCORE\ mailing\ list\ discussed\ a\ problem.\ The\ user\ was\nattempting\ to\ add\ a\ new\ subcommand\ `\[array\]`,\ but\ the\ code\ was\ generating\npeculiar\ results.\ The\ solution,\ as\ provided\ by\ \[dkf\],\ was\ to\ change\ the\nproposed\ code\ so\ that\ the\ `\[proc\]`\ was\ using\ `::set`\ instead\ of\ just\ plain\n`\[set\]`.\ \ The\ reason\ was\ that\ the\ `::tcl::array`\ namespace\ already\ had\ a\n`\[set\]`\ that\ was\ overriding\ `::set`\ and\ resulting\ in\ the\ unexpected\ behavior.\n\nSo,\ this\ note\ is\ not\ specific\ to\ set,\ but\ applies\ in\ general.\ If\ you\ are\ seeing\nbehavior\ that\ reports\ a\ problem\ that\ is\ unexpected,\ examine\ the\ code\ closely\ to\nsee\ if\ you\ need\ to\ add\ namespacing\ to\ the\ commands\ in\ use.\n\n\n\n**\ Make\ an\ Alias\ for\ a\ Command\ **\n\n\[kruzalex\]\ 2013-04-04:\n\nCurrently,\ the\ typical\ idiom\ for\ importing\ commands\ as\ functions\ into\n`\[tcl::mathfunc\]`\ is\ to\ use\ `\[interp\ alias\]`,\ which\ has\ the\nnasty\ effect\ of\ incurring\ some\ performance\ degradation\ on\ each\ invocation\ of\nthe\ alias.\n\nIf\ the\ source\ command\ has\ been\ \[namespace\ export%|%exported\]\ from\ its\ own\nnamespace,\ then\ it\ can\ be\ \[namespace\ import%|%imported\]\ into\ another,\ which\nmakes\ execution\ of\ the\ imported\ command\ considerably\ faster,\ and\ makes\ the\ new\ncommand\ robust\ against\ later\ renaming\ of\ the\ origin\ command.\n\nSometimes\ one\ might\ wish\ for\ more\ than\ what\ `\[namespace\ import\]`\ currently\nprovides:\n\n\ \ \ 1.\ one\ might\ want\ to\ access\ commands\ from\ a\ namespace\ where\ they\ are\ not\ exported\ from.\ e.g.:\ \ `::tcl::unsupported`\ doesn't\ export\ anything,\ so\ `\[disassemble\]`\ cannot\ just\ be\ imported.\n\n\ \ \ 1.\ one\ might\ want\ to\ import\ commands\ to\ a\ different\ name,\ e.g.,\ importing\ `tcl::string::length`\ to\ a\ local\ strlen\n\n\ \ \ 1.\ a\ special\ one:\ if\ one\ tries\ to\ import\ only\ the\ multiplication\ operator\ from\ `::tcl::mathop::*`\ then\ the\ asterisk\ is\ interpreted\ as\ a\ pattern,\ and\ everything\ is\ going\ to\ get\ imported.\n\nI've\ written\ a\ procedure\ that\ looks\ a\ bit\ complicated/awkward,\ but\ addresses\ all\ these\ shortcomings.\ Here\ it\ is:\n\n======\nproc\ alias\ \{src\ tgt\}\ \{\n\ \ \ \ set\ nsrc\ \[namespace\ qualifiers\ \$src\]\n\ \ \ \ set\ tsrc\ \[namespace\ tail\ \$src\]\n\ \ \ \ set\ oe\ \[uplevel\ 1\ \[list\ namespace\ eval\ \$nsrc\ \{namespace\ export\}\]\]\n\ \ \ \ uplevel\ 1\ \[list\ namespace\ eval\ \$nsrc\ \{namespace\ export\ *\}\]\n\ \ \ \ set\ n\ 0\n\ \ \ \ while\ \{\[namespace\ exists\ tmp-\[incr\ n\]\]\}\ \{\}\n\ \ \ \ set\ fqsrc\ \[uplevel\ 1\ \[list\ namespace\ which\ \$src\]\]\n\ \ \ \ namespace\ eval\ tmp-\$n\ \[list\ namespace\ import\ \$fqsrc\]\n\ \ \ \ uplevel\ 1\ \[list\ rename\ \[namespace\ which\ -command\ \"tmp-\$\{n\}::\$tsrc\"\]\ \$tgt\]\n\ \ \ \ uplevel\ 1\ \[list\ namespace\ eval\ \$nsrc\ \[list\ namespace\ export\ -clear\ \{*\}\$oe\]\]\n\ \ \ \ namespace\ delete\ tmp-\$n\n\}\n======\n\n\[PYK\]\ 2014-06-23:\ See\ also\ \[proc\ alias\]\ for\ another\ implementation\ of\ the\ same.\n\nSince\ Tcl8.6,\ \ you\ could\ create\ this\ procedure\ named\ as\ `::tcl::namespace::alias`\ninstead,\ and\ add\ it\ to\ the\ ensemble\ with\ three\ more\ awkward\ lines:\n\n======\nset\ nsmap\ \[namespace\ ensemble\ configure\ namespace\ -map\]\n::dict\ set\ nsmap\ alias\ ::tcl::namespace::alias\nset\ nsmap\ \[dict\ merge\ \$nsmap\ \[dict\ create\ alias\ ::tcl::namespace::alias\]\]\n======\n\nIn\ Tcl8.5\ `namespace`\ isn't\ a\ `\[namespace\ ensemble\]`\ yet,\ but\ the\ \[global\]\nproc\ `alias`\ works\ just\ fine\ with\ Tcl8.5.\n\nExamples:\n\n======\n#\ import\ \"string\ length\"\ as\ \"strlen\"\ to\ be\ used\ within\ expr\nalias\ ::tcl::string::length\ ::tcl::mathfunc::strlen\n\n#\ save\ some\ typing\ in\ an\ interactive\ shell\ :)\nalias\ ::tcl::unsupported::disassemble\ disasm\n======\n\nNote:\ unlike\ `\[interp\ alias\]`,\ \ you\ can\ not\ append\ any\ extra\ arguments\ with\nthis\ \"alias\".\ However,\ if\ the\ intended\ argument\ is\ really\ just\ the\ subcommand\nof\ an\ ensemble\ (as\ is\ string\ length),\ then\ you\ can\ simply\ alias\ the\ subcommand\ndirectly\ :-)\n\nKnown\ bugs:\ specifying\ bad\ arguments\ may\ leave\ some\ empty\ namespace\ and\nexport-patterns\ behind.\ That\ could\ be\ fixed\ with\ `\[try\]`\ or\ `\[catch\]`,\nbut\ I\ thought\ it\ was\ already\ complicated\ enough\ as\ it\ is\ without\ fancy\ error\nhandling.\ Also,\ it\ would\ be\ nice\ to\ be\ able\ to\ specify\ more\ src/tgt\ pairs\ on\none\ invocation...\n\n\[kwilsoft\]:\ The\ copied\ command\ is\ still\ the\ imported\ command\ from\ the\ origin\ namespace.\nHence,\ when\ removing\ command\ from\ origin\ namespace,\ the\ alias\ command\ will\ also\ cease\ to\ work.\ \ Better\ to\ copy\ the\ args\ and\ body\ of\ the\ original\ proc\ to\ the\ new\ namespace\ proc.\n\n\n\n**\ Duplicate\ a\ Namespace\ **\n\nThere\ is\ no\ built-in\ `namespace\ dup`\ command,\ but\ such\ an\ action\ can\ be\ useful\nwhen\ a\ namespace\ is\ part\ of\ the\ implementation\ of\ an\ \[object\norientation%|%object\ system\].\ Tcl's\ \[copy-on-write\]\ semantics\ make\ this\ less\ncostly\ than\ it\ might\ at\ first\ seem.\ Duplicating\ a\ namespace\ involves\nduplicating\ some\ or\ all\ of\ the\ following:\ \n\n\ \ \ \[variable%|%variables\]:\ \ \ Distinguish\ variables\ declared\ by\ `\[upvar\]`\ or\ `\[namespace\ upvar\]`.\ \ Also\ distinguish\ arrays.\ Duplicate\ variables\ that\ are\ declared\ but\ not\ defined.\n\n\ \ \ variable\ traces:\ \ \ \[TO\ DO\]\n\n\ \ \ commands:\ \ \ make\ sure\ to\ distinguish\ between\ native\ and\ \[namespace\ import%|%imported\]\ commands.\ \ Since\ it\ is\ impossible\ to\ import\ by\ exact\ name\ a\ command\ whose\ name\ contains\ a\ glob\ pattern\ character\ such\ as\ `*`\ or\ `?`,\ extra\ care\ must\ be\ taken\ to\ ensure\ that\ the\ proper\ commands\ were\ imported.\ \ Since\ commands\ that\ are\ not\ procedures\ can't\ be\ copied,\ make\ an\ alias\ to\ them.\ \ Also\ make\ sure\ to\ respect\ import\ aliases\ that\ have\ been\ renamed.\n\n\ \ \ command\ traces:\ \ \ \[TO\ DO\]\n\n\ \ \ \[namespace\ export%|%exports\]:\ \ \ simple\ copy\n\n\ \ \ \[namespace\ path%|%path\]:\ \ \ simple\ copy\n\n\ \ \ nested\ namespaces:\ \ \ recursively\ duplicate,\ but\ make\ sure\ not\ to\ descend\ into\ the\ target\ if\ a\ namespace\ is\ duplicated\ to\ some\ descendant.\ \n\n\ \ \ namespace\ unknown:\ \ \ simple\ copy\n\n\n\[ycl%|%ycl::ns::duplicate\]\ implements\ namespace\ duplication\ as\ described\ above,\ except\ for\ duplicating\ traces.\n\n\n\n**\ Misc\ **\n\n\[JeremyM\]\ 2007-09-19:\ \ I'm\ struggling\ with\ the\ decision\ as\ to\ whether\ to\ use\ a\nnamespace\ or\ an\ object\ to\ hold\ code\ and\ variables\ that\ are\ a\ singleton,\ i.e.\ if\nI\ use\ an\ object,\ I\ will\ always\ instantiate\ exactly\ one\ instance\ of\ the\ object.\nBecause\ of\ this,\ a\ namespace\ seems\ like\ a\ more\ appropriate\ container,\ but\ I'm\ngetting\ the\ feeling\ that\ namespaces\ are\ somewhat\ obsolete.\ Plus\ I'm\ not\ crazy\nabout\ mixing\ the\ two\ syntaxes\ in\ one\ set\ of\ scripts.\ So\ the\ question\ is,\ what\nis\ the\ best\ way\ to\ hold\ a\ block\ of\ code\ and\ variables\ that\ are\ a\ singleton?\ \n\n\[Bryan\ Oakley\]\ 2007-09-19:\ \ There\ is\ no\ definitive\ \"best\ way\".\ I\ use\ namespaces\nall\ the\ time.\ I\ even\ use\ them\ for\ \"objects\"\ that\ aren't\ singletons.\ I've\ done\nit\ so\ many\ times\ I\ can\ (almost,\ but\ I\ keep\ trying!)\ do\ it\ with\ my\ eyes\ closed.\nNamespaces\ are\ much\ more\ portable\ than\ objects\ since,\ as\ of\ this\ writing,\ they\nare\ part\ of\ the\ core\ and\ OO\ is\ not.\ If\ portability\ is\ not\ a\ concern\ and\ you\nalready\ use\ an\ object\ system,\ it\ makes\ sense\ to\ continue\ to\ use\ an\ object\nsystem.\ \n\n\[PYK\]\ 2014-06-23:\ \ `\[namespace\]`\ isn't\ obsolete,\ just\ lower-level.\n\n\n\n***\ Private\ namespaces\ ***\n\nAnonymous:\ There\ should\ be\ a\ facility\ in\ Tcl\ to\ define\ a\ \[private\ namespace\].\nAnd,\ in\ a\ completely\ different\ direction,\ \[Darren\ New\]\ points\ out\ that\ \[tcllib\]\nwould\ be\ a\ good\ home\ for\ a\ namespace\ serializer,\ that\ is,\ a\ \[proc\]\ which\ writes\nout\ a\ namespace's\ content\ in\ a\ form\ that\ can\ be\ read\ back\ in\ to\ recreate\ the\nnamespace\ exactly.\n\n\n\[Stu\]\ 2007-09-30:\ Creating\ a\ randomly\ named\ namespace\ with\ global\ vars\ cleanup.\nLeft-to-right\ evaluation\ and\ the\ fact\ that\ `\[for\]`\ and\ `\[unset\]`\ return\nempty\ strings\ are\ what\ makes\ it\ possible.\n\n======\n#\ Random\ namespace\ (10\ chars,\ A-Z)\ with\ vars\ cleanup\nnamespace\ eval\ \[\n\ \ \ \ for\ \{set\ ns\ \{\}\;set\ i\ 0\}\ \{\$i\ <\ 10\}\ \{incr\ i\}\ \{\n\ \ \ \ \ \ \ \ append\ ns\ \[format\ %c\ \[expr\ \{65\ +\ int(rand()\ *\ 26)\}\]\]\n\ \ \ \ \}\n\]\[unset\ i\]\[set\ ns\]\[unset\ ns\]\ \{\n\ \ \ \ \ \ \ \ puts\ \[namespace\ current\]\n\n\ \ \ \ \ \ \ \ #\ Other\ stuff:\ variables,\ procs,\ etc.\n\}\n======\n\n\[Lars\ H\],\ 2007-10-02:\ Edited\ the\ above\ to\ make\ it\ more\ readable.\ Technically\nit's\ sufficient\ that\ `\[unset\]`\ returns\ an\ empty\ string,\ as\ the\ first\ three\ncommand\ substitutions\ in\ the\ namespace\ argument\ of\ `\[namespace\ eval\]`\ could\nbe\ combined\ into\ one.\ Realistically,\ the\ `\[for\]`\ loop\ should\ be\ in\ a\nprocedure\ instead\ to\ avoid\ using\ global\ variables\ at\ all...\n\n\[Stu\]\ 2008-11-16:\ Lars,\ could\ you\ please\ date\ your\ comments?\ The\ one\ you\ added\nbelow\ in\ the\ middle\ of\ the\ paragraph\ arrived\ a\ year\ after\ the\ original\ndiscussion,\ when\ `\[apply\]`\ did\ not\ even\ exist.\ So\ yes,\ now\ with\ Tcl\ 8.5,\ it\ncan\ be\ done\ with\ `apply`\ ...\ I\ guess\ ...\ you\ didn't\ provide\ an\ example.\n\n\[Stu\]\ 2007-10-02:\ But\ where\ would\ you\ put\ the\ command?\ The\ idea\ here\ is\ to\npollute\ the\ global\ namespace\ as\ little\ as\ possible\ and\ to\ create\ a\ unique\nnamespace\ so\ that\ we're\ not\ \"stepping\ on\ anyone's\ toes.\"\ (\[Lars\ H\]:\ Well,\ use\n`\[apply\]`\ then.)\ If\ one\ writes\ namespace-agnostic\ code\ then\ one\ should\ be\ able\ to\n`\[source\]`\ their\ code\ into\ unknown\ environments\ without\ problems.\ Even\ with\na\ `\[proc\]`,\ we\ still\ pollute\ the\ global\ namespace\ -\ one\ proc\ versus\ two\nvariables\ seems\ like\ a\ step\ in\ the\ right\ direction.\n\nThis\ is\ a\ bit\ better\ (I\ like\ it\ in\ one\ line\ but\ this\ is\ easier\ to\nread/understand):\n\n======\n#\ Random\ namespace\ (10\ chars,\ A-Z)\ with\ cleanup,\ using\ \[proc\]\ with\ empty\ proc\ name.\nnamespace\ eval\ \[\n\ \ \ \ proc\ \{\}\ \{\}\ \{\n\ \ \ \ \ \ \ \ set\ ns\ \{\}\n\ \ \ \ \ \ \ \ for\ \{set\ i\ 0\}\ \{\$i\ <\ 10\}\ \{incr\ i\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ append\ ns\ \[format\ %c\ \[expr\ \{65\ +\ int(rand()\ *\ 26)\}\]\]\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ return\ \$ns\n\ \ \ \ \}\n\]\[\{\}\]\[rename\ \{\}\ \{\}\]\ \{\n\ \ \ \ \ \ \ \ puts\ \[namespace\ current\]\n\ \ \ \ \ \ \ \ #\ Other\ stuff:\ variables,\ procs,\ etc.\n\}\n======\n\nUsing\ `\[eval\]`,\ I\ can\ eliminate\ all\ procs\ and\ vars\ and\ it's\ much\ smaller\nmore\ readable:\n\n======\n#\ Random\ namespace\ (10\ chars,\ A-Z)\ with\ cleanup.\nnamespace\ eval\ \[eval\ return\ \[string\ repeat\ \{\[format\ %c\ \[expr\ \{65\ +\ int(rand()\ *\ 26)\}\]\]\}\ 10\]\]\ \{\ \ \ \ \ \n\ \ \ \ puts\ \[namespace\ current\]\n\ \ \ \ #\ Other\ stuff:\ variables,\ procs,\ etc.\n\}\n======\n\nThis\ gives\ an\ interesting\ result\ which\ I\ don't\ understand\ just\ yet.\ \ Put\ the\nabove\ (with\ `\[eval\]`)\ code\ in\ a\ file:\ namespacetest.tcl\n\n======none\n\$\ tclsh\ namespacetest.tcl\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \n::HTUZNJTKOE\n\n\$\ tclsh\n%\ source\ namespacetest.tcl\nNIDZGBNLJP\n======\n\nWhere\ is\ the\ `::`\ ?\n\n\[DKF\]:\ Seems\ to\ me\ like\ the\ `\[return\]`\ might\ be\ confusing\ things,\ causing\nthe\ evaluation\ to\ stop\ before\ the\ \[namespace\ eval\]'s\ body\ fires.\ In\ 8.5\ use\n'''`\[return\]\ -level\ 0`'''\ instead.\n\n\[Stu\]\ 2007-10-02\ Ok\ then,\ (and\ even\ better)\ without\ `\[eval\]`:\n\n======\nnamespace\ eval\ \[subst\ \[string\ repeat\ \{\[format\ %c\ \[expr\ \{65\ +\ int(rand()\ *\ 26)\}\]\]\}\ 10\]\]\ \{\n\ \ \ \ puts\ \[namespace\ current\]\n\n\ \ \ \ #\ Other\ stuff:\ variables,\ procs,\ etc.\n\}\n======\n\n\[Stu\]\ 2008-10-31\ Ultimate\ random\ namespace,\ like\n::TkTwig!(20081031023934)1500<omzpnyxzif>\n\n======\n#!\ /bin/sh\n#\ \\\nexec\ tclsh\ \"\$0\"\ \$\{1+\"\$@\"\}\n\npackage\ require\ Tcl\;\ namespace\ eval\ \\\nMyProg!(\[clock\ format\ \[clock\ seconds\]\ -format\ %Y%m%d%H%M%S\])\[pid\]<\[subst\ \\\n\[string\ repeat\ \{\[format\ %c\ \[expr\ \{97\ +\ int(rand()\ *\ 26)\}\]\]\}\ 10\]\]>\ \{\n\n\n#\ program\ goes\ here\n\n\n\}\;\ #End\ of\ namespace\n\ \n#\ EOF\n======\n\n\[PYK\]\ 2014-06-23:\ \ I\ usually\ just\ use\ `\[info\ cmdcount\]`\n\n======\nnamespace\ eval\ \[info\ cmdcount\]\ \{\n\ \ \ \ ...\n\}\n======\n\nAnd\ for\ good\ measure,\ here's\ an\ example\ using\ `\[apply\]`:\n\n======\nnamespace\ eval\ \[apply\ \[list\ \{\}\ \{\n\ \ \ \ while\ \{\[namespace\ exists\ \[set\ ns\ \[info\ cmdcount\]\]\]\}\ \{\}\n\ \ \ \ return\ \$ns\n\}\ \[namespace\ current\]\]\]\ \{\n\ \ \ \ #script\ goes\ here\n\}\n======\n\n\n\n**\ An\ Anonymous\ Critique\ **\n\n''This\ section\ was\ transplanted\ here\ from\ \[Tcl\ Warts\].''\n\nanonymous\ 2006-03-10:\ The\ concept\ is\ good,\ but\ the\ execution\ is\ flawed,\ especially\ if\ you're\ doing\ anything\ object-oriented.\ \ \ Which\ is\ kind\ of\ ironic,\ given\ that\ (AFAIK)\ namespace\ were\ created\ to\ support\ \[object\ orientation%|%OO\],\ specifically\ \[incr\ Tcl\].\ \ The\ implementation\ has\ the\ fingerprints\ of\ \[C++\]\ all\ over\ the\ syntax.\ Tcl\ is\ many\ things,\ but\ C++\ is\ not\ one\ of\ them.\ \ The\ two\ don't\ fit\ well\ together.\nThe\ concept\ is\ good,\ but\ the\ execution\ is\ flawed,\ especially\ if\ you're\ doing\ anything\ object-oriented.\ \ \ Which\ is\ kind\ of\ ironic,\ given\ that\ (AFAIK)\ namespace\ were\ created\ to\ support\ \[object\ orientation%|%OO\],\ specifically\ \[incr\ Tcl\].\ \ The\ implementation\ has\ the\ fingerprints\ of\ \[C++\]\ all\ over\ the\ syntax.\ Tcl\ is\ many\ things,\ but\ C++\ is\ not\ one\ of\ them.\ \ The\ two\ don't\ fit\ well\ together.\nA\ problem\ that\ I\ keep\ running\ into\ is\ that\ I\ don't\ typically\ use\ the\ global\ scope\ operator\ `::`\ for\ objects\ at\ global\ scope,\ so\ there's\ usually\ a\ string\ inequality\ between\ what\ I'm\ typing\ and\ the\ value\ of\ `\$self`,\ `\$this`,\ `self`,\ whatever\ the\ \[object\ orientation%|%OO\]\ system\ is\ using.\ And\ if\ you\ try\ to\ compose\ object\ names\ by\ combining\ object\ names,\ you\ get\ spurious\ ::'s\ lying\ around\ in\ the\ middle\ of\ names,\ which\ makes\ Tcl\ very\ unhappy.\nA\ problem\ that\ I\ keep\ running\ into\ is\ that\ I\ don't\ typically\ use\ the\ global\ scope\ operator\ `::`\ for\ objects\ at\ global\ scope,\ so\ there's\ usually\ a\ string\ inequality\ between\ what\ I'm\ typing\ and\ the\ value\ of\ `\$self`,\ `\$this`,\ `self`,\ whatever\ the\ \[object\ orienttion%|%OO\]\ system\ is\ using.\ And\ if\ you\ try\ to\ compose\ object\ names\ by\ combining\ object\ names,\ you\ get\ spurious\ ::'s\ lying\ around\ in\ the\ middle\ of\ names,\ which\ makes\ Tcl\ very\ unhappy.\n\[DKF\]\ 2015-06-11:\ Namespaces\ are\ not\ objects.\ They\ form\ the\ foundation\ for\ object\ systems,\ but\ are\ not\ objects\ (because\ you\ need\ commands\ as\ well,\ and\ in\ fact\ quite\ a\ lot\ of\ other\ stuff\ too).\ What's\ more,\ the\ names\ of\ objects\ generally\ should\ always\ be\ fully-qualified\ command\ names\;\ anything\ else\ is\ usually\ just\ an\ abbreviated\ form.\ (The\ exception\ are\ widget\ names,\ which\ are\ unqualified\ but\ always\ start\ with\ a\ `.`\ character.)\n\[DKF\]:\ Namespaces\ are\ not\ objects.\ They\ form\ the\ foundation\ for\ object\ systems,\ but\ are\ not\ objects\ (because\ you\ need\ commands\ as\ well,\ and\ in\ fact\ quite\ a\ lot\ of\ other\ stuff\ too).\ What's\ more,\ the\ names\ of\ objects\ generally\ should\ always\ be\ fully-qualified\ command\ names\;\ anything\ else\ is\ usually\ just\ an\ abbreviated\ form.\ (The\ exception\ are\ widget\ names,\ which\ are\ unqualified\ but\ always\ start\ with\ a\ `.`\ character.)\n----\n\n\ \ \ \[http://sourceforge.net/mailarchive/message.php?msg_id=7731007%|%TCLCORE\ Re:\ incr\ Tcl\ in\ the\ core?\],\ tcl-core\ mailing\ list,\ 2000-11-09:\ \ \ \[KBK\]\ recounts\ the\ panel\ discussion\ at\ the\ \[Third\ Annual\ Tcl/Tk\ Workshop\]\ that\ led\ to\ the\ inclusion\ of\ `namespace`\ in\ the\ core\n\n\n<<categories>>\ Command\ |\ Introspection\ |\ Syntax\ |\ Arts\ and\ Crafts\ of\ Tcl-Tk\ Programming regexp2} CALL {my render namespace '''\[http://www.tcl.tk/man/tcl/TclCmd/namespace.htm%|%namespace\]'''\ is\ a\ \[Tcl\ Commands%|%built-in\]\ \[namespace\ ensemble%|%ensemble\]\ of\ \[command%|%commands\]\ for\ working\ with\nnamespaces.\n\n\n\n**\ Synopsis\ **\n\n\ \ \ \ :\ \ \ '''\[namespace\ children\]'''\ ''?namespace?\ ?pattern?''\n\n\ \ \ \ :\ \ \ '''\[namespace\ code\]'''\ ''script''\n\n\ \ \ \ :\ \ \ '''\[namespace\ current\]'''\n\n\ \ \ \ :\ \ \ '''\[namespace\ delete\]'''\ ''?namespace\ namespace\ ...?''\n\n\ \ \ \ :\ \ \ '''\[namespace\ ensemble\]'''\ ''option\ ?arg\ ...?''\n\n\ \ \ \ :\ \ \ '''\[namespace\ eval\]'''\ ''namespace\ arg\ ?arg\ ...?''\n\n\ \ \ \ :\ \ \ '''\[namespace\ exists\]'''\ ''namespace''\n\n\ \ \ \ :\ \ \ '''\[namespace\ export\]'''\ ''?-'''''clear'''''?\ ?pattern\ pattern\ ...?''\n\n\ \ \ \ :\ \ \ '''\[namespace\ forget\]'''\ ''?pattern\ pattern\ ...?''\n\n\ \ \ \ :\ \ \ '''\[namespace\ import\]'''\ ''?-'''''force'''''?\ ?pattern\ pattern\ ...?''\n\n\ \ \ \ :\ \ \ '''\[namespace\ inscope\]'''\ ''namespace\ script\ ?arg\ ...?''\n\n\ \ \ \ :\ \ \ '''\[namespace\ origin\]'''\ ''command''\n\n\ \ \ \ :\ \ \ '''\[namespace\ parent\]'''\ ''?namespace?''\n\n\ \ \ \ :\ \ \ '''\[namespace\ path\]'''\ ''?namespaceList?''\n\n\ \ \ \ :\ \ \ '''\[namespace\ qualifiers\]'''\ ''string''\n\n\ \ \ \ :\ \ \ '''\[namespace\ tail\]'''\ ''string''\n\n\ \ \ \ :\ \ \ '''\[namespace\ upvar\]'''\ ''namespace\ otherVar\ myVar\ ?otherVar\ myVar\ ...?''\n\n\ \ \ \ :\ \ \ '''\[namespace\ unknown\]'''\ ''?script?''\n\n\ \ \ \ :\ \ \ '''\[namespace\ which\]'''\ ''?-'''''command'''''?\ ?-'''''variable'''''?\ name''\n\n\n\n**\ See\ Also\ **\n\n\ \ \ \[::\]:\ \ \ the\ namespace\ delimiter\n\n\ \ \ \[ns\],\ by\ \[stu\]:\ \ \ an\ additional\ set\ of\ commands\ for\ working\ with\ namespaces\ \n\n\ \ \ \[namespace\ size\]:\ \ \ \n\n\ \ \ \[Thoughts\ on\ Namespaces\ and\ OO\]:\ \ \ \n\n\ \ \ \[Namespace\ variables\ 2\]:\ \ \ \n\n\ \ \ \[Namespace\ resolution\ of\ Variables\ &\ Procedures\]:\ \ \ \n\n\ \ \ \[data\ is\ code\]:\ \ \ \n\n\ \ \ \[_namespace\ import_\ and\ _rename_\]:\ \ \ describes\ the\ extraordinary\ freedom\ won\ through\ the\ use\ of\ namespaces.\n\n\ \ \ \[closure%|%closures\]:\ \ \ Used\ in\ other\ languages\ to\ do\ what\ is\ done\ in\ Tcl\ using\ namespaces.\n\n\n\n\ \ \ \[http://www.tcl.tk/man/tcl/TclCmd/namespace.htm%|%official\ reference\ documentation\]:\ \ \ \n\n\ \ \ \[http://www.wjduquette.com/tcl/namespaces.html%|%Namespaces\ and\ Packages\],\ by\ \[William\ Duquette\]:\ \ \ \ \n\n\ \ \ \[http://www.rpbourret.com/xml/NamespacesFAQ.htm%|%XML\ Namespaces\ FAQ\]:\ \ \ valuable\ background\ information\ on\ the\ general\ use\ of\ namespaces\ in\ computing\n\n\ \ \ \[http://www.intertwingly.net/stories/2002/09/09/gentleIntroductionToNamespaces.html%|%A\ Gentle\ Introduction\ to\ Namespaces\],\ by\ \[Sam\ Ruby\]\ 2002:\ \ \ an\ \[XML\]-focused\ description\n\n\n\n**\ \ Proposals\ **\n\nEach\ namespace\ is\ actually\ three\ separate\ namespaces:\ One\ for\nAlthough\ namespaces\ and\ commands\ can\ have\ identical\ names,\ those\ names\ refer\ to\ndifferent\ things,\ even\ when\ a\ command\ is\ a\ namespace\ ensemble\ command\ for\ a\nnamespace\ having\ the\ same\ name\ as\ the\ command.\ \ Now\ try\ to\ say\ that\ last\nsentence\ 10\ times\ quickly.\ \n======\nnamespace\ which\ -variable\ ::one::two::three::four\ \;#\ ->\ ::one::two::three::four\n\n\nCan\ someone\ discuss\ how\ a\ Tcl\ script\ can\ determine:\n\n\ \ \ *\ what\ namespaces\ are\ available\ at\ any\ particular\ point\ in\ time\ \n\ \ \ *\ what\ procs\ and\ variables\ available\ in\ any\ one\ of\ these\ namespaces\n\nA\ simple\ `\[proc\]`\ to\ list\ all\ child\ namespaces,\ recursively:\n\n======\nproc\ listns\ \{\{parentns\ ::\}\}\ \{\n\ \ \ \ foreach\ ns\ \[namespace\ children\ \$parentns\]\ \{\n\ \ \ \ \ \ \ \ eval\ lappend\ result\ \[listns\ \$ns\]\n\ \ \ \ \ \ \ \ lappend\ result\ \$ns\n\ \ \ \ \}\n\ \ \ \ return\ \$result\n\}\n======\n\noutput:\n\n======\n%\ namespace\ eval\ ::test\ \{set\ foo\ 1\}\n1\n\n%\ namespace\ eval\ ::test2\ \{set\ foo\ 1\}\n1\n\n%\ namespace\ eval\ ::test::test3\ \{set\ foo\ 1\}\n1\n\n%\ listns\n::test::test3\ ::test\ ::test2\ ::tcl\n======\n\nFrom\ 8.5\ onwards,\ use\ this\ instead:\n\n======\nproc\ listns\ \{\{parentns\ ::\}\}\ \{\n\ \ \ \ set\ result\ \[list\]\n\ \ \ \ foreach\ ns\ \[namespace\ children\ \$parentns\]\ \{\n\ \ \ \ \ \ \ \ lappend\ result\ \{*\}\[listns\ \$ns\]\ \$ns\n\ \ \ \ \}\n\ \ \ \ return\ \$result\n\}\n======\n\n\nlist\ the\ variables\ in\ a\ namespace:\n\n======\nproc\ listnsvars\ \{\{ns\ ::\}\}\ \{\n\ \ \ \ return\ \[info\ vars\ \$\{ns\}::*\]\n\}\n======\n\nlist\ the\ procs\ in\ a\ namespace:\n\n======\nproc\ listnsprocs\ \{\{ns\ ::\}\}\ \{\n\ \ \ \ return\ \[info\ procs\ \$\{ns\}::*\]\n\}\n======\n\nlist\ the\ commands\ in\ a\ namespace:\n\n======\nproc\ listnscommands\ \{\{ns\ ::\}\}\ \{\n\ \ \ \ return\ \[info\ commands\ \$\{ns\}::*\]\n\}\n======\n\nThe\ previous\ examples\ only\ work\ well\ with\ fully\ qualified\ namespace\ names.\n\nBeware\ that\ in\ some\ apps\ these\ may\ take\ a\ long\ time\ to\ complete\ (for\ example,\nif\ there\ are\ hundreds\ of\ thousands\ of\ commands\ in\ ::).\n\n\n**\ Avoiding\ `\[variable\]`\ declarations\ in\ `\[proc\]`edures\ **\n\nchild\ namespace\ to\ be\ convenient.\ \ Instead\ of:\nchild\ namespace\ to\ be\ very\ convenient.\ \ Instead\ of:\n======\nnamespace\ eval\ TO\ \{\n\ \ \ \ variable\ foo\n\ \ \ \ proc\ proc1\ \{\}\ \{\n\ \ \ \ \ \ \ \ variable\ foo\n\ \ \ \ \ \ \ \ ...\ use\ \$foo\ ...\n\ \ \ \ \}\n\}\n======\n\nConsider\ using:\n\n======\nnamespace\ eval\ TO\ \{\n\ \ \ \ namespace\ eval\ v\ \{\n\ \ \ \ \ \ \ \ variable\ foo\n\ \ \ \ \}\n\ \ \ \ proc\ proc1\ \{\}\ \{\n\ \ \ \ \ \ \ \ ...\ use\ \$v::foo\ ...\n\ \ \ \ \}\n\}\n======\n\nNo\ more\ lists\ of\ `\[variable\]`\ calls\ inside\ each\ proc.\ \ The\ other\ way\ is\ to\ put\nall\ your\ variables\ inside\ a\ single\ `\[array\]`,\ but\ my\ impression\ is\ that\ the\ `v::*`\napproach\ is\ slightly\ faster\ (`\[variable\]`\ seems\ to\ take\ a\ bit\ of\ time,\ don't\ know\nwhy).\n\n\n\n**\ Procedure\ Resolution\ **\n\nWhen\ referring\ to\ a\ variable\ or\ a\ `\[proc\]`\ in\ a\ namespace\ embedded\ in\ other\nnamespaces,\ Tcl\ first\ searches\ the\ current\ namespace\ and\ then\ the\ \[global\]\nnamespace\ (as\ documented)\ and\ '''doesn't\ look\ in\ any\ intervening\ embedding\nnamespaces''':\n\n======\nproc\ ::p\ \{\}\ \{puts\ \{I'm\ ::p\}\}\nnamespace\ eval\ ns\ \{\n\ \ \ \ proc\ p\ \{\}\ \{puts\ \{I'm\ ns::p\}\}\n\ \ \ \ namespace\ eval\ child\ \{\n\ \ \ \ \ \ \ \ p\n\ \ \ \ \}\n\}\n======\n\nResult:\n\n======none\nI'm\ ::p\n======\n\nTcl\ resolved\ the\ name\ in\ the\ \[global\]\ namespace\ and\ didn't\ search\ in\ the\nintervening\ `ns`\ namespace.\n\nThis\ behaviour\ can\ be\ modified\ via\ `\[namespace\ path\]`.\n\n----\n\n\[LVwikignoming\]\ 2010-07-01\ 13:03:52:\n\nA\ recent\ email\ on\ the\ TCLCORE\ mailing\ list\ discussed\ a\ problem.\ The\ user\ was\nattempting\ to\ add\ a\ new\ subcommand\ `\[array\]`,\ but\ the\ code\ was\ generating\npeculiar\ results.\ The\ solution,\ as\ provided\ by\ \[dkf\],\ was\ to\ change\ the\nproposed\ code\ so\ that\ the\ `\[proc\]`\ was\ using\ `::set`\ instead\ of\ just\ plain\n`\[set\]`.\ \ The\ reason\ was\ that\ the\ `::tcl::array`\ namespace\ already\ had\ a\n`\[set\]`\ that\ was\ overriding\ `::set`\ and\ resulting\ in\ the\ unexpected\ behavior.\n\nSo,\ this\ note\ is\ not\ specific\ to\ set,\ but\ applies\ in\ general.\ If\ you\ are\ seeing\nbehavior\ that\ reports\ a\ problem\ that\ is\ unexpected,\ examine\ the\ code\ closely\ to\nsee\ if\ you\ need\ to\ add\ namespacing\ to\ the\ commands\ in\ use.\n\n\n\n**\ Make\ an\ Alias\ for\ a\ Command\ **\n\n\[kruzalex\]\ 2013-04-04:\n\nCurrently,\ the\ typical\ idiom\ for\ importing\ commands\ as\ functions\ into\n`\[tcl::mathfunc\]`\ is\ to\ use\ `\[interp\ alias\]`,\ which\ has\ the\nnasty\ effect\ of\ incurring\ some\ performance\ degradation\ on\ each\ invocation\ of\nthe\ alias.\n\nIf\ the\ source\ command\ has\ been\ \[namespace\ export%|%exported\]\ from\ its\ own\nnamespace,\ then\ it\ can\ be\ \[namespace\ import%|%imported\]\ into\ another,\ which\nmakes\ execution\ of\ the\ imported\ command\ considerably\ faster,\ and\ makes\ the\ new\ncommand\ robust\ against\ later\ renaming\ of\ the\ origin\ command.\n\nSometimes\ one\ might\ wish\ for\ more\ than\ what\ `\[namespace\ import\]`\ currently\nprovides:\n\n\ \ \ 1.\ one\ might\ want\ to\ access\ commands\ from\ a\ namespace\ where\ they\ are\ not\ exported\ from.\ e.g.:\ \ `::tcl::unsupported`\ doesn't\ export\ anything,\ so\ `\[disassemble\]`\ cannot\ just\ be\ imported.\n\n\ \ \ 1.\ one\ might\ want\ to\ import\ commands\ to\ a\ different\ name,\ e.g.,\ importing\ `tcl::string::length`\ to\ a\ local\ strlen\n\n\ \ \ 1.\ a\ special\ one:\ if\ one\ tries\ to\ import\ only\ the\ multiplication\ operator\ from\ `::tcl::mathop::*`\ then\ the\ asterisk\ is\ interpreted\ as\ a\ pattern,\ and\ everything\ is\ going\ to\ get\ imported.\n\nI've\ written\ a\ procedure\ that\ looks\ a\ bit\ complicated/awkward,\ but\ addresses\ all\ these\ shortcomings.\ Here\ it\ is:\n\n======\nproc\ alias\ \{src\ tgt\}\ \{\n\ \ \ \ set\ nsrc\ \[namespace\ qualifiers\ \$src\]\n\ \ \ \ set\ tsrc\ \[namespace\ tail\ \$src\]\n\ \ \ \ set\ oe\ \[uplevel\ 1\ \[list\ namespace\ eval\ \$nsrc\ \{namespace\ export\}\]\]\n\ \ \ \ uplevel\ 1\ \[list\ namespace\ eval\ \$nsrc\ \{namespace\ export\ *\}\]\n\ \ \ \ set\ n\ 0\n\ \ \ \ while\ \{\[namespace\ exists\ tmp-\[incr\ n\]\]\}\ \{\}\n\ \ \ \ set\ fqsrc\ \[uplevel\ 1\ \[list\ namespace\ which\ \$src\]\]\n\ \ \ \ namespace\ eval\ tmp-\$n\ \[list\ namespace\ import\ \$fqsrc\]\n\ \ \ \ uplevel\ 1\ \[list\ rename\ \[namespace\ which\ -command\ \"tmp-\$\{n\}::\$tsrc\"\]\ \$tgt\]\n\ \ \ \ uplevel\ 1\ \[list\ namespace\ eval\ \$nsrc\ \[list\ namespace\ export\ -clear\ \{*\}\$oe\]\]\n\ \ \ \ namespace\ delete\ tmp-\$n\n\}\n======\n\n\[PYK\]\ 2014-06-23:\ See\ also\ \[proc\ alias\]\ for\ another\ implementation\ of\ the\ same.\n\nSince\ Tcl8.6,\ \ you\ could\ create\ this\ procedure\ named\ as\ `::tcl::namespace::alias`\ninstead,\ and\ add\ it\ to\ the\ ensemble\ with\ three\ more\ awkward\ lines:\n\n======\nset\ nsmap\ \[namespace\ ensemble\ configure\ namespace\ -map\]\n::dict\ set\ nsmap\ alias\ ::tcl::namespace::alias\nset\ nsmap\ \[dict\ merge\ \$nsmap\ \[dict\ create\ alias\ ::tcl::namespace::alias\]\]\n======\n\nIn\ Tcl8.5\ `namespace`\ isn't\ a\ `\[namespace\ ensemble\]`\ yet,\ but\ the\ \[global\]\nproc\ `alias`\ works\ just\ fine\ with\ Tcl8.5.\n\nExamples:\n\n======\n#\ import\ \"string\ length\"\ as\ \"strlen\"\ to\ be\ used\ within\ expr\nalias\ ::tcl::string::length\ ::tcl::mathfunc::strlen\n\n#\ save\ some\ typing\ in\ an\ interactive\ shell\ :)\nalias\ ::tcl::unsupported::disassemble\ disasm\n======\n\nNote:\ unlike\ `\[interp\ alias\]`,\ \ you\ can\ not\ append\ any\ extra\ arguments\ with\nthis\ \"alias\".\ However,\ if\ the\ intended\ argument\ is\ really\ just\ the\ subcommand\nof\ an\ ensemble\ (as\ is\ string\ length),\ then\ you\ can\ simply\ alias\ the\ subcommand\ndirectly\ :-)\n\nKnown\ bugs:\ specifying\ bad\ arguments\ may\ leave\ some\ empty\ namespace\ and\nexport-patterns\ behind.\ That\ could\ be\ fixed\ with\ `\[try\]`\ or\ `\[catch\]`,\nbut\ I\ thought\ it\ was\ already\ complicated\ enough\ as\ it\ is\ without\ fancy\ error\nhandling.\ Also,\ it\ would\ be\ nice\ to\ be\ able\ to\ specify\ more\ src/tgt\ pairs\ on\none\ invocation...\n\n\[kwilsoft\]:\ The\ copied\ command\ is\ still\ the\ imported\ command\ from\ the\ origin\ namespace.\nHence,\ when\ removing\ command\ from\ origin\ namespace,\ the\ alias\ command\ will\ also\ cease\ to\ work.\ \ Better\ to\ copy\ the\ args\ and\ body\ of\ the\ original\ proc\ to\ the\ new\ namespace\ proc.\n\n\n\n**\ Duplicate\ a\ Namespace\ **\n\nThere\ is\ no\ built-in\ `namespace\ dup`\ command,\ but\ such\ an\ action\ can\ be\ useful\nwhen\ a\ namespace\ is\ part\ of\ the\ implementation\ of\ an\ \[object\norientation%|%object\ system\].\ Tcl's\ \[copy-on-write\]\ semantics\ make\ this\ less\ncostly\ than\ it\ might\ at\ first\ seem.\ Duplicating\ a\ namespace\ involves\nduplicating\ some\ or\ all\ of\ the\ following:\ \n\n\ \ \ \[variable%|%variables\]:\ \ \ Distinguish\ variables\ declared\ by\ `\[upvar\]`\ or\ `\[namespace\ upvar\]`.\ \ Also\ distinguish\ arrays.\ Duplicate\ variables\ that\ are\ declared\ but\ not\ defined.\n\n\ \ \ variable\ traces:\ \ \ \[TO\ DO\]\n\n\ \ \ commands:\ \ \ make\ sure\ to\ distinguish\ between\ native\ and\ \[namespace\ import%|%imported\]\ commands.\ \ Since\ it\ is\ impossible\ to\ import\ by\ exact\ name\ a\ command\ whose\ name\ contains\ a\ glob\ pattern\ character\ such\ as\ `*`\ or\ `?`,\ extra\ care\ must\ be\ taken\ to\ ensure\ that\ the\ proper\ commands\ were\ imported.\ \ Since\ commands\ that\ are\ not\ procedures\ can't\ be\ copied,\ make\ an\ alias\ to\ them.\ \ Also\ make\ sure\ to\ respect\ import\ aliases\ that\ have\ been\ renamed.\n\n\ \ \ command\ traces:\ \ \ \[TO\ DO\]\n\n\ \ \ \[namespace\ export%|%exports\]:\ \ \ simple\ copy\n\n\ \ \ \[namespace\ path%|%path\]:\ \ \ simple\ copy\n\n\ \ \ nested\ namespaces:\ \ \ recursively\ duplicate,\ but\ make\ sure\ not\ to\ descend\ into\ the\ target\ if\ a\ namespace\ is\ duplicated\ to\ some\ descendant.\ \n\n\ \ \ namespace\ unknown:\ \ \ simple\ copy\n\n\n\[ycl%|%ycl::ns::duplicate\]\ implements\ namespace\ duplication\ as\ described\ above,\ except\ for\ duplicating\ traces.\n\n\n\n**\ Misc\ **\n\n\[JeremyM\]\ 2007-09-19:\ \ I'm\ struggling\ with\ the\ decision\ as\ to\ whether\ to\ use\ a\nnamespace\ or\ an\ object\ to\ hold\ code\ and\ variables\ that\ are\ a\ singleton,\ i.e.\ if\nI\ use\ an\ object,\ I\ will\ always\ instantiate\ exactly\ one\ instance\ of\ the\ object.\nBecause\ of\ this,\ a\ namespace\ seems\ like\ a\ more\ appropriate\ container,\ but\ I'm\ngetting\ the\ feeling\ that\ namespaces\ are\ somewhat\ obsolete.\ Plus\ I'm\ not\ crazy\nabout\ mixing\ the\ two\ syntaxes\ in\ one\ set\ of\ scripts.\ So\ the\ question\ is,\ what\nis\ the\ best\ way\ to\ hold\ a\ block\ of\ code\ and\ variables\ that\ are\ a\ singleton?\ \n\n\[Bryan\ Oakley\]\ 2007-09-19:\ \ There\ is\ no\ definitive\ \"best\ way\".\ I\ use\ namespaces\nall\ the\ time.\ I\ even\ use\ them\ for\ \"objects\"\ that\ aren't\ singletons.\ I've\ done\nit\ so\ many\ times\ I\ can\ (almost,\ but\ I\ keep\ trying!)\ do\ it\ with\ my\ eyes\ closed.\nNamespaces\ are\ much\ more\ portable\ than\ objects\ since,\ as\ of\ this\ writing,\ they\nare\ part\ of\ the\ core\ and\ OO\ is\ not.\ If\ portability\ is\ not\ a\ concern\ and\ you\nalready\ use\ an\ object\ system,\ it\ makes\ sense\ to\ continue\ to\ use\ an\ object\nsystem.\ \n\n\[PYK\]\ 2014-06-23:\ \ `\[namespace\]`\ isn't\ obsolete,\ just\ lower-level.\n\n\n\n***\ Private\ namespaces\ ***\n\nAnonymous:\ There\ should\ be\ a\ facility\ in\ Tcl\ to\ define\ a\ \[private\ namespace\].\nAnd,\ in\ a\ completely\ different\ direction,\ \[Darren\ New\]\ points\ out\ that\ \[tcllib\]\nwould\ be\ a\ good\ home\ for\ a\ namespace\ serializer,\ that\ is,\ a\ \[proc\]\ which\ writes\nout\ a\ namespace's\ content\ in\ a\ form\ that\ can\ be\ read\ back\ in\ to\ recreate\ the\nnamespace\ exactly.\n\n\n\[Stu\]\ 2007-09-30:\ Creating\ a\ randomly\ named\ namespace\ with\ global\ vars\ cleanup.\nLeft-to-right\ evaluation\ and\ the\ fact\ that\ `\[for\]`\ and\ `\[unset\]`\ return\nempty\ strings\ are\ what\ makes\ it\ possible.\n\n======\n#\ Random\ namespace\ (10\ chars,\ A-Z)\ with\ vars\ cleanup\nnamespace\ eval\ \[\n\ \ \ \ for\ \{set\ ns\ \{\}\;set\ i\ 0\}\ \{\$i\ <\ 10\}\ \{incr\ i\}\ \{\n\ \ \ \ \ \ \ \ append\ ns\ \[format\ %c\ \[expr\ \{65\ +\ int(rand()\ *\ 26)\}\]\]\n\ \ \ \ \}\n\]\[unset\ i\]\[set\ ns\]\[unset\ ns\]\ \{\n\ \ \ \ \ \ \ \ puts\ \[namespace\ current\]\n\n\ \ \ \ \ \ \ \ #\ Other\ stuff:\ variables,\ procs,\ etc.\n\}\n======\n\n\[Lars\ H\],\ 2007-10-02:\ Edited\ the\ above\ to\ make\ it\ more\ readable.\ Technically\nit's\ sufficient\ that\ `\[unset\]`\ returns\ an\ empty\ string,\ as\ the\ first\ three\ncommand\ substitutions\ in\ the\ namespace\ argument\ of\ `\[namespace\ eval\]`\ could\nbe\ combined\ into\ one.\ Realistically,\ the\ `\[for\]`\ loop\ should\ be\ in\ a\nprocedure\ instead\ to\ avoid\ using\ global\ variables\ at\ all...\n\n\[Stu\]\ 2008-11-16:\ Lars,\ could\ you\ please\ date\ your\ comments?\ The\ one\ you\ added\nbelow\ in\ the\ middle\ of\ the\ paragraph\ arrived\ a\ year\ after\ the\ original\ndiscussion,\ when\ `\[apply\]`\ did\ not\ even\ exist.\ So\ yes,\ now\ with\ Tcl\ 8.5,\ it\ncan\ be\ done\ with\ `apply`\ ...\ I\ guess\ ...\ you\ didn't\ provide\ an\ example.\n\n\[Stu\]\ 2007-10-02:\ But\ where\ would\ you\ put\ the\ command?\ The\ idea\ here\ is\ to\npollute\ the\ global\ namespace\ as\ little\ as\ possible\ and\ to\ create\ a\ unique\nnamespace\ so\ that\ we're\ not\ \"stepping\ on\ anyone's\ toes.\"\ (\[Lars\ H\]:\ Well,\ use\n`\[apply\]`\ then.)\ If\ one\ writes\ namespace-agnostic\ code\ then\ one\ should\ be\ able\ to\n`\[source\]`\ their\ code\ into\ unknown\ environments\ without\ problems.\ Even\ with\na\ `\[proc\]`,\ we\ still\ pollute\ the\ global\ namespace\ -\ one\ proc\ versus\ two\nvariables\ seems\ like\ a\ step\ in\ the\ right\ direction.\n\nThis\ is\ a\ bit\ better\ (I\ like\ it\ in\ one\ line\ but\ this\ is\ easier\ to\nread/understand):\n\n======\n#\ Random\ namespace\ (10\ chars,\ A-Z)\ with\ cleanup,\ using\ \[proc\]\ with\ empty\ proc\ name.\nnamespace\ eval\ \[\n\ \ \ \ proc\ \{\}\ \{\}\ \{\n\ \ \ \ \ \ \ \ set\ ns\ \{\}\n\ \ \ \ \ \ \ \ for\ \{set\ i\ 0\}\ \{\$i\ <\ 10\}\ \{incr\ i\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ append\ ns\ \[format\ %c\ \[expr\ \{65\ +\ int(rand()\ *\ 26)\}\]\]\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ return\ \$ns\n\ \ \ \ \}\n\]\[\{\}\]\[rename\ \{\}\ \{\}\]\ \{\n\ \ \ \ \ \ \ \ puts\ \[namespace\ current\]\n\ \ \ \ \ \ \ \ #\ Other\ stuff:\ variables,\ procs,\ etc.\n\}\n======\n\nUsing\ `\[eval\]`,\ I\ can\ eliminate\ all\ procs\ and\ vars\ and\ it's\ much\ smaller\nmore\ readable:\n\n======\n#\ Random\ namespace\ (10\ chars,\ A-Z)\ with\ cleanup.\nnamespace\ eval\ \[eval\ return\ \[string\ repeat\ \{\[format\ %c\ \[expr\ \{65\ +\ int(rand()\ *\ 26)\}\]\]\}\ 10\]\]\ \{\ \ \ \ \ \n\ \ \ \ puts\ \[namespace\ current\]\n\ \ \ \ #\ Other\ stuff:\ variables,\ procs,\ etc.\n\}\n======\n\nThis\ gives\ an\ interesting\ result\ which\ I\ don't\ understand\ just\ yet.\ \ Put\ the\nabove\ (with\ `\[eval\]`)\ code\ in\ a\ file:\ namespacetest.tcl\n\n======none\n\$\ tclsh\ namespacetest.tcl\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \n::HTUZNJTKOE\n\n\$\ tclsh\n%\ source\ namespacetest.tcl\nNIDZGBNLJP\n======\n\nWhere\ is\ the\ `::`\ ?\n\n\[DKF\]:\ Seems\ to\ me\ like\ the\ `\[return\]`\ might\ be\ confusing\ things,\ causing\nthe\ evaluation\ to\ stop\ before\ the\ \[namespace\ eval\]'s\ body\ fires.\ In\ 8.5\ use\n'''`\[return\]\ -level\ 0`'''\ instead.\n\n\[Stu\]\ 2007-10-02\ Ok\ then,\ (and\ even\ better)\ without\ `\[eval\]`:\n\n======\nnamespace\ eval\ \[subst\ \[string\ repeat\ \{\[format\ %c\ \[expr\ \{65\ +\ int(rand()\ *\ 26)\}\]\]\}\ 10\]\]\ \{\n\ \ \ \ puts\ \[namespace\ current\]\n\n\ \ \ \ #\ Other\ stuff:\ variables,\ procs,\ etc.\n\}\n======\n\n\[Stu\]\ 2008-10-31\ Ultimate\ random\ namespace,\ like\n::TkTwig!(20081031023934)1500<omzpnyxzif>\n\n======\n#!\ /bin/sh\n#\ \\\nexec\ tclsh\ \"\$0\"\ \$\{1+\"\$@\"\}\n\npackage\ require\ Tcl\;\ namespace\ eval\ \\\nMyProg!(\[clock\ format\ \[clock\ seconds\]\ -format\ %Y%m%d%H%M%S\])\[pid\]<\[subst\ \\\n\[string\ repeat\ \{\[format\ %c\ \[expr\ \{97\ +\ int(rand()\ *\ 26)\}\]\]\}\ 10\]\]>\ \{\n\n\n#\ program\ goes\ here\n\n\n\}\;\ #End\ of\ namespace\n\ \n#\ EOF\n======\n\n\[PYK\]\ 2014-06-23:\ \ I\ usually\ just\ use\ `\[info\ cmdcount\]`\n\n======\nnamespace\ eval\ \[info\ cmdcount\]\ \{\n\ \ \ \ ...\n\}\n======\n\nAnd\ for\ good\ measure,\ here's\ an\ example\ using\ `\[apply\]`:\n\n======\nnamespace\ eval\ \[apply\ \[list\ \{\}\ \{\n\ \ \ \ while\ \{\[namespace\ exists\ \[set\ ns\ \[info\ cmdcount\]\]\]\}\ \{\}\n\ \ \ \ return\ \$ns\n\}\ \[namespace\ current\]\]\]\ \{\n\ \ \ \ #script\ goes\ here\n\}\n======\n\n\n\n**\ An\ Anonymous\ Critique\ **\n\n''This\ section\ was\ transplanted\ here\ from\ \[Tcl\ Warts\].''\n\nanonymous\ 2006-03-10:\ The\ concept\ is\ good,\ but\ the\ execution\ is\ flawed,\ especially\ if\ you're\ doing\ anything\ object-oriented.\ \ \ Which\ is\ kind\ of\ ironic,\ given\ that\ (AFAIK)\ namespace\ were\ created\ to\ support\ \[object\ orientation%|%OO\],\ specifically\ \[incr\ Tcl\].\ \ The\ implementation\ has\ the\ fingerprints\ of\ \[C++\]\ all\ over\ the\ syntax.\ Tcl\ is\ many\ things,\ but\ C++\ is\ not\ one\ of\ them.\ \ The\ two\ don't\ fit\ well\ together.\nThe\ concept\ is\ good,\ but\ the\ execution\ is\ flawed,\ especially\ if\ you're\ doing\ anything\ object-oriented.\ \ \ Which\ is\ kind\ of\ ironic,\ given\ that\ (AFAIK)\ namespace\ were\ created\ to\ support\ \[object\ orientation%|%OO\],\ specifically\ \[incr\ Tcl\].\ \ The\ implementation\ has\ the\ fingerprints\ of\ \[C++\]\ all\ over\ the\ syntax.\ Tcl\ is\ many\ things,\ but\ C++\ is\ not\ one\ of\ them.\ \ The\ two\ don't\ fit\ well\ together.\nA\ problem\ that\ I\ keep\ running\ into\ is\ that\ I\ don't\ typically\ use\ the\ global\ scope\ operator\ `::`\ for\ objects\ at\ global\ scope,\ so\ there's\ usually\ a\ string\ inequality\ between\ what\ I'm\ typing\ and\ the\ value\ of\ `\$self`,\ `\$this`,\ `self`,\ whatever\ the\ \[object\ orientation%|%OO\]\ system\ is\ using.\ And\ if\ you\ try\ to\ compose\ object\ names\ by\ combining\ object\ names,\ you\ get\ spurious\ ::'s\ lying\ around\ in\ the\ middle\ of\ names,\ which\ makes\ Tcl\ very\ unhappy.\nA\ problem\ that\ I\ keep\ running\ into\ is\ that\ I\ don't\ typically\ use\ the\ global\ scope\ operator\ `::`\ for\ objects\ at\ global\ scope,\ so\ there's\ usually\ a\ string\ inequality\ between\ what\ I'm\ typing\ and\ the\ value\ of\ `\$self`,\ `\$this`,\ `self`,\ whatever\ the\ \[object\ orienttion%|%OO\]\ system\ is\ using.\ And\ if\ you\ try\ to\ compose\ object\ names\ by\ combining\ object\ names,\ you\ get\ spurious\ ::'s\ lying\ around\ in\ the\ middle\ of\ names,\ which\ makes\ Tcl\ very\ unhappy.\n\[DKF\]\ 2015-06-11:\ Namespaces\ are\ not\ objects.\ They\ form\ the\ foundation\ for\ object\ systems,\ but\ are\ not\ objects\ (because\ you\ need\ commands\ as\ well,\ and\ in\ fact\ quite\ a\ lot\ of\ other\ stuff\ too).\ What's\ more,\ the\ names\ of\ objects\ generally\ should\ always\ be\ fully-qualified\ command\ names\;\ anything\ else\ is\ usually\ just\ an\ abbreviated\ form.\ (The\ exception\ are\ widget\ names,\ which\ are\ unqualified\ but\ always\ start\ with\ a\ `.`\ character.)\n\[DKF\]:\ Namespaces\ are\ not\ objects.\ They\ form\ the\ foundation\ for\ object\ systems,\ but\ are\ not\ objects\ (because\ you\ need\ commands\ as\ well,\ and\ in\ fact\ quite\ a\ lot\ of\ other\ stuff\ too).\ What's\ more,\ the\ names\ of\ objects\ generally\ should\ always\ be\ fully-qualified\ command\ names\;\ anything\ else\ is\ usually\ just\ an\ abbreviated\ form.\ (The\ exception\ are\ widget\ names,\ which\ are\ unqualified\ but\ always\ start\ with\ a\ `.`\ character.)\n----\n\n\ \ \ \[http://sourceforge.net/mailarchive/message.php?msg_id=7731007%|%TCLCORE\ Re:\ incr\ Tcl\ in\ the\ core?\],\ tcl-core\ mailing\ list,\ 2000-11-09:\ \ \ \[KBK\]\ recounts\ the\ panel\ discussion\ at\ the\ \[Third\ Annual\ Tcl/Tk\ Workshop\]\ that\ led\ to\ the\ inclusion\ of\ `namespace`\ in\ the\ core\n\n\n<<categories>>\ Command\ |\ Introspection\ |\ Syntax\ |\ Arts\ and\ Crafts\ of\ Tcl-Tk\ Programming} CALL {my revision namespace} CALL {::oo::Obj3034588 process revision/namespace} CALL {::oo::Obj3034586 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