Error processing request

Parameters

CONTENT_LENGTH0
REQUEST_METHODGET
REQUEST_URI/revision/split?V=49
QUERY_STRINGV=49
CONTENT_TYPE
DOCUMENT_URI/revision/split
DOCUMENT_ROOT/var/www/nikit/nikit/nginx/../docroot
SCGI1
SERVER_PROTOCOLHTTP/1.1
HTTPSon
REMOTE_ADDR172.70.131.99
REMOTE_PORT44668
SERVER_PORT4443
SERVER_NAMEwiki.tcl-lang.org
HTTP_HOSTwiki.tcl-lang.org
HTTP_CONNECTIONKeep-Alive
HTTP_ACCEPT_ENCODINGgzip, br
HTTP_X_FORWARDED_FOR3.145.112.210
HTTP_CF_RAY882c4fe338d88743-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_CF_CONNECTING_IP3.145.112.210
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 split split\ -\ Split\ a\ string\ into\ a\ proper\ Tcl\ list\n\n\ split\ string\ ?splitChars?\ \n\nReturns\ a\ list\ created\ by\ splitting\ string\ at\ each\ character\ that\ is\ in\ the\ splitChars\ argument.\ \nEach\ element\ of\ the\ result\ list\ will\ consist\ of\ the\ characters\ from\ string\ \nthat\ lie\ between\ instances\ of\ the\ characters\ in\ splitChars.\ \nEmpty\ list\ elements\ will\ be\ generated\ if\ string\ contains\ adjacent\ characters\ in\ splitChars,\ \nor\ if\ the\ first\ or\ last\ character\ of\ string\ is\ in\ splitChars.\ \nIf\ splitChars\ is\ an\ empty\ string\ then\ each\ character\ of\ string\ \nbecomes\ a\ separate\ element\ of\ the\ result\ list.\ \nSplitChars\ defaults\ to\ the\ standard\ white-space\ characters.\ \nFor\ example,\n\n\ split\ \"comp.unix.misc\"\ .\n\nreturns\ \"comp\ unix\ misc\"\ and\n\n\ split\ \"Hello\ world\"\ \{\}\n\nreturns\ \"H\ e\ l\ l\ o\ \{\ \}\ w\ o\ r\ l\ d\".\n======none\n\n\[DKF\]:\ I\ believe\ there's\ a\ standard\ (ANSI?\ POSIX?)\ somewhere.\ \ But\ the\ answer\n\[DKF\]:\ I\ believe\ there's\ a\ standard\ (ANSI?\ POSIX?)\ somewhere.\ \ \nBut\ the\ answer\ includes\ \"space\",\ \"tab\",\ and\ \"newline\".\n\[escargo\]:\ By\ \"tab\"\ do\ you\ mean\ both\ horizontal\ tab\ (ASCII\ 9)\ and\ vertical\ tab\n''\[escargo\]''\ -\ By\ \"tab\"\ do\ you\ mean\ both\ horizontal\ tab\ (ASCII\ 9)\ and\ \nvertical\ tab\ (ASCII\ 11)?\ \ (See\ http://www.asciitable.com/)\ \ \nArguments\ could\ be\ made\ for\ most\ of\ the\ ASCII\ characters\ under\ 33.\n\[Strick\]:\ Let's\ ask\ Tcl\ what\ it\ thinks\ are\ white:\n\n\ \$\ env\ |\ grep\ en_\n\ LANG=en_US.UTF-8\n\ \$\ cat\ what-chars-does-split-think-are-white.tcl\n\ for\ \{set\ i\ 0\}\ \{\$i<65536\}\ \{incr\ i\}\ \{\n\ \ \ if\ \{\[llength\ \[format\ \"/%c/\"\ \$i\]\]\ >\ 1\}\ \{\ puts\ -nonewline\ \"\$i\ \"\ \}\n\ \}\n\ \$\ tclsh\ what-chars-does-split-think-are-white.tcl\n\ 9\ 10\ 11\ 12\ 13\ 32\ \$\n\[escargo\]\ 2005-04-01\ :\n\n''\[escargo\]\ 4\ Jan\ 2005''\ -\n9\ =\ ASCII\ TAB,\ 10\ =\ ASCII\ LF\ (line\ feed),\ 11\ =\ ASCII\ VT\ (vertical\ tab),\ \n12\ =\ ASCII\ FF\ (form\ feed),\ 13\ =\ ASCII\ CR\ (carriage\ return),\ and\ of\ course\ 32\ =\ ASCII\ Space.\n9\ =\ ASCII\ TAB,\ 10\ =\ ASCII\ LF\ (line\ feed),\ 11\ =\ ASCII\ VT\ (vertical\ tab),\ 12\ =\nI\ would\ have\ thought\ that\ the\ separator\ characters\ would\ count\ as\ white\ space\ (28-31,\ \nFS,\ GS,\ RS,\ US),\ but\ I\ guess\ they\ are\ regarded\ as\ \"nonprinting\"\ characters.\nI\ would\ have\ thought\ that\ the\ separator\ characters\ would\ count\ as\ white\ space\n\n\[Strick\]:\ Oops,\ i\ forgot\ to\ actually\ use\ split\ in\ my\ script\ above.\ \ So\ now\ I\n\[Strick\]:\ Oops,\ i\ forgot\ to\ actually\ use\ split\ in\ my\ script\ above.\ \ \nSo\ now\ I\ test\ four\ different\ notions\ of\ white,\ and\ get\ three\ different\ answers.\nI\ understand\ why\ Tcl's\ builtin\ list-splitting\ rules\ must\ be\ fixed,\ regardless\ of\ locale.\nBut\ it\ seems\ 'split'\ should\ use\ the\ list-splitting\ rule\ or\ the\ the\ 'string\ is\ space'\ rule,\ \nbut\ it\ uses\ its\ own\ (pre-unicode?)\ rule:\n\ \$\ cat\ what-chars-does-split-think-are-white.tcl\n\ puts\ \"tcl=\[info\ patch\]\ LANG=\$env(LANG)\"\nputs\ -nonewline\ \{according\ to\ llength:\ \}\n\ puts\ -nonewline\ \"according\ to\ llength:\ \"\n\ for\ \{set\ i\ 0\}\ \{\$i<65536\}\ \{incr\ i\}\ \{\n\ \ \ if\ \{\[llength\ \[format\ \"/%c/\"\ \$i\]\]\ >\ 1\}\ \{\ puts\ -nonewline\ \"\$i\ \"\ \}\n\ \}\n\ puts\ \"\"\nputs\ -nonewline\ \{according\ to\ split:\ \}\n\ puts\ -nonewline\ \"according\ to\ split:\ \"\n\ for\ \{set\ i\ 0\}\ \{\$i<65536\}\ \{incr\ i\}\ \{\n\ \ \ if\ \{\[llength\ \[split\ \[format\ \"/%c/\"\ \$i\]\]\]\ >\ 1\}\ \{\ puts\ -nonewline\ \"\$i\ \"\ \}\n\ \}\n\ puts\ \"\"\nputs\ -nonewline\ \{according\ to\ 'string\ is\ space':\ \}\n\ puts\ -nonewline\ \"according\ to\ 'string\ is\ space':\ \"\n\ for\ \{set\ i\ 0\}\ \{\$i<65536\}\ \{incr\ i\}\ \{\n\ \ \ if\ \{\[string\ is\ space\ \[format\ \"%c\"\ \$i\]\]\}\ \{\ puts\ -nonewline\ \"\$i\ \"\ \}\n\ \}\n\ puts\ \"\"\nputs\ -nonewline\ \{according\ to\ regexp\ \{\\s\}:\ \}\n\ puts\ -nonewline\ \"according\ to\ regexp\ \{\\\\s\}:\ \"\n\ for\ \{set\ i\ 0\}\ \{\$i<65536\}\ \{incr\ i\}\ \{\n\ \ \ if\ \{\[regexp\ \{\\s\}\ \[format\ \"%c\"\ \$i\]\]\}\ \{\ puts\ -nonewline\ \"\$i\ \"\ \}\n\ \}\n\ puts\ \"\"\n\$\n\ \$\n\ \$\ tclsh\ what-chars-does-split-think-are-white.tcl\n\ tcl=8.4.7\ LANG=en_US.UTF-8\n\ according\ to\ llength:\ 9\ 10\ 11\ 12\ 13\ 32\n\ according\ to\ split:\ 9\ 10\ 13\ 32\n\ according\ to\ 'string\ is\ space':\ 9\ 10\ 11\ 12\ 13\ 32\ 160\ 5760\ 8192\ 8193\ 8194\ 8195\ 8196\ 8197\ 8198\ 8199\ 8200\ 8201\ 8202\ 8203\ 8232\ 8233\ 8239\ 12288\n\ according\ to\ regexp\ \{\\s\}:\ 9\ 10\ 11\ 12\ 13\ 32\ 160\ 5760\ 8192\ 8193\ 8194\ 8195\ 8196\ 8197\ 8198\ 8199\ 8200\ 8201\ 8202\ 8203\ 8232\ 8233\ 8239\ 12288\n\ \$\n\[escargo\]\ 2006-01-27:\ If\ split\ used\ chars\ 9\ 10\ 11\ 12\ 13\ 32\ then\ there\ would\ be\n''\[escargo\]\ 27\ Jan\ 2006''\ -\ If\ split\ used\ chars\ 9\ 10\ 11\ 12\ 13\ 32\ then\ there\ would\ be\ only\ two\ sets,\ with\ the\ smaller\ set\ as\ a\ proper\ subset\ of\ the\ larger\ set.\ \ \nThe\ two\ characters\ that\ would\ have\ to\ be\ added\ are\ the\ vertical\ tab\ and\ form\ feed.\n----\nNote\ that\ the\ argument\ named\ ''splitChars''\ above\ is\ a\ series\ of\ 0\ to\ n\ individual\ characters.\ \ \nHowever,\ if\ you\ want\ to\ split\ on\ a\ specific\ sequence\ of\ 2\ or\ more\ characters\ together,\ \nor\ if\ you\ want\ to\ split\ on\ a\ regular\ expression,\ split\ will\ not\ work\ for\ you.\ \ \nSee\ \[Tcllib\]'s\ \[textutil\]::split::splitx\ for\ that\ functionality.\n\n\[SS\]\ 2004/01/31\ -\ or\ you\ can\ use\ the\ following\ function:\nThis\ version\ is\ recursive,\ so\ it\ may\ be\ better\ to\ rewrite\ it\ if\ you\ plan\ to\ use\n\ proc\ wsplit\ \{string\ sep\}\ \{\n\ \ \ \ \ set\ first\ \[string\ first\ \$sep\ \$string\]\n\ \ \ \ \ if\ \{\$first\ ==\ -1\}\ \{\n\ \ \ \ \ \ \ \ \ return\ \[list\ \$string\]\n\ \ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ \ set\ l\ \[string\ length\ \$sep\]\n\ \ \ \ \ \ \ \ \ set\ left\ \[string\ range\ \$string\ 0\ \[expr\ \{\$first-1\}\]\]\n\ \ \ \ \ \ \ \ \ set\ right\ \[string\ range\ \$string\ \[expr\ \{\$first+\$l\}\]\ end\]\n\ \ \ \ \ \ \ \ \ return\ \[concat\ \[list\ \$left\]\ \[wsplit\ \$right\ \$sep\]\]\n\ \ \ \ \ \}\n\ \}\n\nThis\ version\ is\ recursive,\ so\ it\ may\ be\ better\ to\ rewrite\ it\ if\ you\ plan\ to\ use\ the\ function\nagainst\ very\ long\ strings\ with\ many\ separators.\ The\ difference\ between\ wsplit\ and\ splitx\nis\ that\ splitx\ uses\ regexp,\ so\ it\ may\ create\ problems\ with\ unknown\ separators.\n\[IL\]\ 2005-01-03:\ on\ the\ near\ anniversary\ of\ this\ proc,\ the\ iterative\ version,\n\[IL\]\ 2005/01/03\ -\ on\ the\ near\ anniversary\ of\ this\ proc,\ the\ iterative\ version,\ \nquick\ n\ dirty\ since\ I'm\ in\ a\ hurry\ to\ parse\ some\ html...\n======\n\ proc\ wsplit\ \{\ str\ sepStr\ \}\ \{\n\n\ \ \ \ set\ strList\ \ \ \[list\]\n\ \ \ \ set\ sepLength\ \[string\ length\ \$sepStr\]\n\ \ \ while\ \{\[set\ index\ \[string\ first\ \$sepStr\ \$str\]\]\ !=\ -1\}\ \{\n\ \ \ \ while\ \{\ \[set\ index\ \[string\ first\ \$sepStr\ \$str\]\]\ !=\ \"-1\"\ \}\ \{\n\n\ \ \ \ \ \ \ \ set\ left\ \[string\ range\ \$str\ 0\ \[expr\ \$index\ +\ \$sepLength\ -\ 1\]\]\n\ \ \ \ \ \ \ \ set\ str\ \ \[string\ range\ \$str\ \[expr\ \$index\ +\ \$sepLength\ +\ 1\]\ end\]\n\ \ \ \ \ \ \ \ lappend\ strList\ \$left\n\ \ \ \ \}\n\n\ \ \ \ return\ \$strList\n\ \}\n\n\ hmm\ use\ this\ version\ instead,\ the\ string\ first\ doesn't\ catch\ strings\ sepstrs\n\ connected\ to\ the\ ones\ you\ want\ \n\n\ proc\ wsplit\ \{\ str\ sepStr\ \}\ \{\n\n\ \ \ \ if\ \{\ !\[regexp\ \$sepStr\ \$str\]\ \}\ \{\ return\ \$str\ \}\n\n\ \ \ \ set\ strList\ \ \ \[list\]\n\n\ \ \ \ set\ pattern\ \"(.*?)\$sepStr\"\n\ \ \ \ while\ \{\ \[regexp\ \$pattern\ \$str\ match\ left\]\ \}\ \{\n\n\ \ \ \ \ \ \ \ lappend\ strList\ \$left\n\ \ \ \ \ \ \ \ regsub\ \$pattern\ \$str\ \"\"\ str\n\ \ \ \ \}\n\ \ \ \ \n\ \ \ \ lappend\ strList\ \$str\n\n\ \ \ \ return\ \$strList\n\ \}\n\[RS\]\ writes\ recently:\n\nNote\ that\ the\ wsplit\ can\ be\ done\ simpler:\n\n\ \ \ \ 2.\ split\ on\ that\ single\ char\n\n----\n\ proc\ wsplit\ \{str\ sep\}\ \{\n\ \ \ split\ \[string\ map\ \[list\ \$sep\ \\0\]\ \$str\]\ \\0\n\ \}\n\ %\ wsplit\ This<>is<>a<>test.\ <>\n\ This\ is\ a\ test.\n\n\n''2006-06-21''\ \[Sarnold\]\ Here\ is\ my\ version\ of\ wsplit:\n\n\ \ \ \ proc\ wsplit\ \{str\ sep\}\ \{\n\ \ \ \ \ \ \ \ set\ out\ \"\"\n\ \ \ \ \ \ \ \ set\ sepLen\ \[string\ length\ \$sep\]\n\ \ \ \ \ \ \ \ if\ \{\$sepLen\ <2\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ return\ \[split\ \$str\ \$sep\]\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ while\ \{\[set\ idx\ \[string\ first\ \$sep\ \$str\]\]\ >=\ 0\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$idx>=0\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #\ the\ left\ part\ :\ the\ current\ element\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lappend\ out\ \[string\ range\ \$str\ 0\ \[expr\ \{\$idx-1\}\]\]\n\ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ #\ get\ the\ right\ part\ and\ iterate\ with\ it\n\ \ \ \ \ \ \ \ \ \ \ \ set\ str\ \[string\ range\ \$str\ \[incr\ idx\ \$sepLen\]\ end\]\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ #\ there\ is\ no\ separator\ anymore,\ but\ keep\ in\ mind\ the\ right\ part\ must\ be\ appended\n\ \ \ \ \ \ \ \ lappend\ out\ \$str\n\ \ \ \ #\ there\ is\ no\ separator\ anymore,\ but\ keep\ in\ mind\ the\ right\ part\ must\ be\n----\n\n\[escargo\]:\ So\ what\ should\ you\ use\ when\ you\ don't\ care\ how\ many\ spaces\ were\nSo\ what\ should\ you\ use\ when\ you\ don't\ care\ how\ many\ spaces\ were\ between\ tokens,\nyou\ just\ want\ the\ nonblank\ tokens\ in\ the\ list\ and\ none\ of\ the\ separators?\n''--\ \[escargo\]''\n\[RS\]:\ Easy,\ just\ use\ a\ filter:\n\n\ proc\ filter\ \{cond\ list\}\ \{\n\ \ \ \ set\ res\ \{\}\n\ \ \ \ foreach\ element\ \$list\ \{if\ \[\$cond\ \$element\]\ \{lappend\ res\ \$element\}\}\n\ \ \ \ set\ res\n\ \}\n\ %\ filter\ llength\ \[split\ \"a\ \ \ list\ \ \ with\ many\ \ \ spaces\"\]\n\ a\ list\ with\ many\ spaces\n...\ or\ use\n\n\ %\ split\ \[regsub\ -all\ \{\[\ \\t\\n\]+\}\ \"a\ \ \ list\ \ \ with\ many\ \ \ spaces\"\ \{\ \}\]\ \n\n...\ or\ use\ \n\n\ %\ lreplace\ \"a\ \ \ list\ \ \ with\ many\ \ \ spaces\"\ 0\ -1\n\n\n----\nSee\ \[Counting\ characters\ in\ a\ string\]\ where\ \[split\]\ was\ pretty\ good...\n----\nKaitzschu\ mentions,\ on\ \[comp.lang.tcl\],\ this\ piece\ of\ info\ \nwhich\ is\ supposedly\ somewhere\ in\ the\ man\ pages:\n\n\"If\ splitChars\ is\ an\ empty\ string\ then\ each\ character\ of\ string\ \nbecomes\ a\ separate\ element\ of\ the\ result\ list.\"\ \n======\nThus,\ \n\n\ set\ l\ \[split\ \{abcdefghijklmnopqrstuvwxyz\}\ \{\}\]\n\nresults\ in\ a\ list\ where\ each\ character\ is\ turned\ into\ a\ separate\ list\ entry.\n----\nSee\ also\ the\ man\ page\ at\ http://www.purl.org/tcl/home/man/tcl8.4/TclCmd/split.htm\ .\n----\n\nSee\ also:\ \n\ \ \ *\ \[join\]\n\ \ \ *\ \[list\]\n\ \ \ *\ \[Splitting\ strings\ with\ embedded\ strings\]\ \n----\n\[Arts\ and\ crafts\ of\ Tcl-Tk\ programming\]\ \n\n\[Tcl\ syntax\ help\]\ -\ \n\[Category\ Command\]\ -\n\[Category\ String\ Processing\] regexp2} CALL {my render split split\ -\ Split\ a\ string\ into\ a\ proper\ Tcl\ list\n\n\ split\ string\ ?splitChars?\ \n\nReturns\ a\ list\ created\ by\ splitting\ string\ at\ each\ character\ that\ is\ in\ the\ splitChars\ argument.\ \nEach\ element\ of\ the\ result\ list\ will\ consist\ of\ the\ characters\ from\ string\ \nthat\ lie\ between\ instances\ of\ the\ characters\ in\ splitChars.\ \nEmpty\ list\ elements\ will\ be\ generated\ if\ string\ contains\ adjacent\ characters\ in\ splitChars,\ \nor\ if\ the\ first\ or\ last\ character\ of\ string\ is\ in\ splitChars.\ \nIf\ splitChars\ is\ an\ empty\ string\ then\ each\ character\ of\ string\ \nbecomes\ a\ separate\ element\ of\ the\ result\ list.\ \nSplitChars\ defaults\ to\ the\ standard\ white-space\ characters.\ \nFor\ example,\n\n\ split\ \"comp.unix.misc\"\ .\n\nreturns\ \"comp\ unix\ misc\"\ and\n\n\ split\ \"Hello\ world\"\ \{\}\n\nreturns\ \"H\ e\ l\ l\ o\ \{\ \}\ w\ o\ r\ l\ d\".\n======none\n\n\[DKF\]:\ I\ believe\ there's\ a\ standard\ (ANSI?\ POSIX?)\ somewhere.\ \ But\ the\ answer\n\[DKF\]:\ I\ believe\ there's\ a\ standard\ (ANSI?\ POSIX?)\ somewhere.\ \ \nBut\ the\ answer\ includes\ \"space\",\ \"tab\",\ and\ \"newline\".\n\[escargo\]:\ By\ \"tab\"\ do\ you\ mean\ both\ horizontal\ tab\ (ASCII\ 9)\ and\ vertical\ tab\n''\[escargo\]''\ -\ By\ \"tab\"\ do\ you\ mean\ both\ horizontal\ tab\ (ASCII\ 9)\ and\ \nvertical\ tab\ (ASCII\ 11)?\ \ (See\ http://www.asciitable.com/)\ \ \nArguments\ could\ be\ made\ for\ most\ of\ the\ ASCII\ characters\ under\ 33.\n\[Strick\]:\ Let's\ ask\ Tcl\ what\ it\ thinks\ are\ white:\n\n\ \$\ env\ |\ grep\ en_\n\ LANG=en_US.UTF-8\n\ \$\ cat\ what-chars-does-split-think-are-white.tcl\n\ for\ \{set\ i\ 0\}\ \{\$i<65536\}\ \{incr\ i\}\ \{\n\ \ \ if\ \{\[llength\ \[format\ \"/%c/\"\ \$i\]\]\ >\ 1\}\ \{\ puts\ -nonewline\ \"\$i\ \"\ \}\n\ \}\n\ \$\ tclsh\ what-chars-does-split-think-are-white.tcl\n\ 9\ 10\ 11\ 12\ 13\ 32\ \$\n\[escargo\]\ 2005-04-01\ :\n\n''\[escargo\]\ 4\ Jan\ 2005''\ -\n9\ =\ ASCII\ TAB,\ 10\ =\ ASCII\ LF\ (line\ feed),\ 11\ =\ ASCII\ VT\ (vertical\ tab),\ \n12\ =\ ASCII\ FF\ (form\ feed),\ 13\ =\ ASCII\ CR\ (carriage\ return),\ and\ of\ course\ 32\ =\ ASCII\ Space.\n9\ =\ ASCII\ TAB,\ 10\ =\ ASCII\ LF\ (line\ feed),\ 11\ =\ ASCII\ VT\ (vertical\ tab),\ 12\ =\nI\ would\ have\ thought\ that\ the\ separator\ characters\ would\ count\ as\ white\ space\ (28-31,\ \nFS,\ GS,\ RS,\ US),\ but\ I\ guess\ they\ are\ regarded\ as\ \"nonprinting\"\ characters.\nI\ would\ have\ thought\ that\ the\ separator\ characters\ would\ count\ as\ white\ space\n\n\[Strick\]:\ Oops,\ i\ forgot\ to\ actually\ use\ split\ in\ my\ script\ above.\ \ So\ now\ I\n\[Strick\]:\ Oops,\ i\ forgot\ to\ actually\ use\ split\ in\ my\ script\ above.\ \ \nSo\ now\ I\ test\ four\ different\ notions\ of\ white,\ and\ get\ three\ different\ answers.\nI\ understand\ why\ Tcl's\ builtin\ list-splitting\ rules\ must\ be\ fixed,\ regardless\ of\ locale.\nBut\ it\ seems\ 'split'\ should\ use\ the\ list-splitting\ rule\ or\ the\ the\ 'string\ is\ space'\ rule,\ \nbut\ it\ uses\ its\ own\ (pre-unicode?)\ rule:\n\ \$\ cat\ what-chars-does-split-think-are-white.tcl\n\ puts\ \"tcl=\[info\ patch\]\ LANG=\$env(LANG)\"\nputs\ -nonewline\ \{according\ to\ llength:\ \}\n\ puts\ -nonewline\ \"according\ to\ llength:\ \"\n\ for\ \{set\ i\ 0\}\ \{\$i<65536\}\ \{incr\ i\}\ \{\n\ \ \ if\ \{\[llength\ \[format\ \"/%c/\"\ \$i\]\]\ >\ 1\}\ \{\ puts\ -nonewline\ \"\$i\ \"\ \}\n\ \}\n\ puts\ \"\"\nputs\ -nonewline\ \{according\ to\ split:\ \}\n\ puts\ -nonewline\ \"according\ to\ split:\ \"\n\ for\ \{set\ i\ 0\}\ \{\$i<65536\}\ \{incr\ i\}\ \{\n\ \ \ if\ \{\[llength\ \[split\ \[format\ \"/%c/\"\ \$i\]\]\]\ >\ 1\}\ \{\ puts\ -nonewline\ \"\$i\ \"\ \}\n\ \}\n\ puts\ \"\"\nputs\ -nonewline\ \{according\ to\ 'string\ is\ space':\ \}\n\ puts\ -nonewline\ \"according\ to\ 'string\ is\ space':\ \"\n\ for\ \{set\ i\ 0\}\ \{\$i<65536\}\ \{incr\ i\}\ \{\n\ \ \ if\ \{\[string\ is\ space\ \[format\ \"%c\"\ \$i\]\]\}\ \{\ puts\ -nonewline\ \"\$i\ \"\ \}\n\ \}\n\ puts\ \"\"\nputs\ -nonewline\ \{according\ to\ regexp\ \{\\s\}:\ \}\n\ puts\ -nonewline\ \"according\ to\ regexp\ \{\\\\s\}:\ \"\n\ for\ \{set\ i\ 0\}\ \{\$i<65536\}\ \{incr\ i\}\ \{\n\ \ \ if\ \{\[regexp\ \{\\s\}\ \[format\ \"%c\"\ \$i\]\]\}\ \{\ puts\ -nonewline\ \"\$i\ \"\ \}\n\ \}\n\ puts\ \"\"\n\$\n\ \$\n\ \$\ tclsh\ what-chars-does-split-think-are-white.tcl\n\ tcl=8.4.7\ LANG=en_US.UTF-8\n\ according\ to\ llength:\ 9\ 10\ 11\ 12\ 13\ 32\n\ according\ to\ split:\ 9\ 10\ 13\ 32\n\ according\ to\ 'string\ is\ space':\ 9\ 10\ 11\ 12\ 13\ 32\ 160\ 5760\ 8192\ 8193\ 8194\ 8195\ 8196\ 8197\ 8198\ 8199\ 8200\ 8201\ 8202\ 8203\ 8232\ 8233\ 8239\ 12288\n\ according\ to\ regexp\ \{\\s\}:\ 9\ 10\ 11\ 12\ 13\ 32\ 160\ 5760\ 8192\ 8193\ 8194\ 8195\ 8196\ 8197\ 8198\ 8199\ 8200\ 8201\ 8202\ 8203\ 8232\ 8233\ 8239\ 12288\n\ \$\n\[escargo\]\ 2006-01-27:\ If\ split\ used\ chars\ 9\ 10\ 11\ 12\ 13\ 32\ then\ there\ would\ be\n''\[escargo\]\ 27\ Jan\ 2006''\ -\ If\ split\ used\ chars\ 9\ 10\ 11\ 12\ 13\ 32\ then\ there\ would\ be\ only\ two\ sets,\ with\ the\ smaller\ set\ as\ a\ proper\ subset\ of\ the\ larger\ set.\ \ \nThe\ two\ characters\ that\ would\ have\ to\ be\ added\ are\ the\ vertical\ tab\ and\ form\ feed.\n----\nNote\ that\ the\ argument\ named\ ''splitChars''\ above\ is\ a\ series\ of\ 0\ to\ n\ individual\ characters.\ \ \nHowever,\ if\ you\ want\ to\ split\ on\ a\ specific\ sequence\ of\ 2\ or\ more\ characters\ together,\ \nor\ if\ you\ want\ to\ split\ on\ a\ regular\ expression,\ split\ will\ not\ work\ for\ you.\ \ \nSee\ \[Tcllib\]'s\ \[textutil\]::split::splitx\ for\ that\ functionality.\n\n\[SS\]\ 2004/01/31\ -\ or\ you\ can\ use\ the\ following\ function:\nThis\ version\ is\ recursive,\ so\ it\ may\ be\ better\ to\ rewrite\ it\ if\ you\ plan\ to\ use\n\ proc\ wsplit\ \{string\ sep\}\ \{\n\ \ \ \ \ set\ first\ \[string\ first\ \$sep\ \$string\]\n\ \ \ \ \ if\ \{\$first\ ==\ -1\}\ \{\n\ \ \ \ \ \ \ \ \ return\ \[list\ \$string\]\n\ \ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ \ set\ l\ \[string\ length\ \$sep\]\n\ \ \ \ \ \ \ \ \ set\ left\ \[string\ range\ \$string\ 0\ \[expr\ \{\$first-1\}\]\]\n\ \ \ \ \ \ \ \ \ set\ right\ \[string\ range\ \$string\ \[expr\ \{\$first+\$l\}\]\ end\]\n\ \ \ \ \ \ \ \ \ return\ \[concat\ \[list\ \$left\]\ \[wsplit\ \$right\ \$sep\]\]\n\ \ \ \ \ \}\n\ \}\n\nThis\ version\ is\ recursive,\ so\ it\ may\ be\ better\ to\ rewrite\ it\ if\ you\ plan\ to\ use\ the\ function\nagainst\ very\ long\ strings\ with\ many\ separators.\ The\ difference\ between\ wsplit\ and\ splitx\nis\ that\ splitx\ uses\ regexp,\ so\ it\ may\ create\ problems\ with\ unknown\ separators.\n\[IL\]\ 2005-01-03:\ on\ the\ near\ anniversary\ of\ this\ proc,\ the\ iterative\ version,\n\[IL\]\ 2005/01/03\ -\ on\ the\ near\ anniversary\ of\ this\ proc,\ the\ iterative\ version,\ \nquick\ n\ dirty\ since\ I'm\ in\ a\ hurry\ to\ parse\ some\ html...\n======\n\ proc\ wsplit\ \{\ str\ sepStr\ \}\ \{\n\n\ \ \ \ set\ strList\ \ \ \[list\]\n\ \ \ \ set\ sepLength\ \[string\ length\ \$sepStr\]\n\ \ \ while\ \{\[set\ index\ \[string\ first\ \$sepStr\ \$str\]\]\ !=\ -1\}\ \{\n\ \ \ \ while\ \{\ \[set\ index\ \[string\ first\ \$sepStr\ \$str\]\]\ !=\ \"-1\"\ \}\ \{\n\n\ \ \ \ \ \ \ \ set\ left\ \[string\ range\ \$str\ 0\ \[expr\ \$index\ +\ \$sepLength\ -\ 1\]\]\n\ \ \ \ \ \ \ \ set\ str\ \ \[string\ range\ \$str\ \[expr\ \$index\ +\ \$sepLength\ +\ 1\]\ end\]\n\ \ \ \ \ \ \ \ lappend\ strList\ \$left\n\ \ \ \ \}\n\n\ \ \ \ return\ \$strList\n\ \}\n\n\ hmm\ use\ this\ version\ instead,\ the\ string\ first\ doesn't\ catch\ strings\ sepstrs\n\ connected\ to\ the\ ones\ you\ want\ \n\n\ proc\ wsplit\ \{\ str\ sepStr\ \}\ \{\n\n\ \ \ \ if\ \{\ !\[regexp\ \$sepStr\ \$str\]\ \}\ \{\ return\ \$str\ \}\n\n\ \ \ \ set\ strList\ \ \ \[list\]\n\n\ \ \ \ set\ pattern\ \"(.*?)\$sepStr\"\n\ \ \ \ while\ \{\ \[regexp\ \$pattern\ \$str\ match\ left\]\ \}\ \{\n\n\ \ \ \ \ \ \ \ lappend\ strList\ \$left\n\ \ \ \ \ \ \ \ regsub\ \$pattern\ \$str\ \"\"\ str\n\ \ \ \ \}\n\ \ \ \ \n\ \ \ \ lappend\ strList\ \$str\n\n\ \ \ \ return\ \$strList\n\ \}\n\[RS\]\ writes\ recently:\n\nNote\ that\ the\ wsplit\ can\ be\ done\ simpler:\n\n\ \ \ \ 2.\ split\ on\ that\ single\ char\n\n----\n\ proc\ wsplit\ \{str\ sep\}\ \{\n\ \ \ split\ \[string\ map\ \[list\ \$sep\ \\0\]\ \$str\]\ \\0\n\ \}\n\ %\ wsplit\ This<>is<>a<>test.\ <>\n\ This\ is\ a\ test.\n\n\n''2006-06-21''\ \[Sarnold\]\ Here\ is\ my\ version\ of\ wsplit:\n\n\ \ \ \ proc\ wsplit\ \{str\ sep\}\ \{\n\ \ \ \ \ \ \ \ set\ out\ \"\"\n\ \ \ \ \ \ \ \ set\ sepLen\ \[string\ length\ \$sep\]\n\ \ \ \ \ \ \ \ if\ \{\$sepLen\ <2\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ return\ \[split\ \$str\ \$sep\]\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ while\ \{\[set\ idx\ \[string\ first\ \$sep\ \$str\]\]\ >=\ 0\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ if\ \{\$idx>=0\}\ \{\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #\ the\ left\ part\ :\ the\ current\ element\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ lappend\ out\ \[string\ range\ \$str\ 0\ \[expr\ \{\$idx-1\}\]\]\n\ \ \ \ \ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ \ \ \ \ #\ get\ the\ right\ part\ and\ iterate\ with\ it\n\ \ \ \ \ \ \ \ \ \ \ \ set\ str\ \[string\ range\ \$str\ \[incr\ idx\ \$sepLen\]\ end\]\n\ \ \ \ \ \ \ \ \}\n\ \ \ \ \ \ \ \ #\ there\ is\ no\ separator\ anymore,\ but\ keep\ in\ mind\ the\ right\ part\ must\ be\ appended\n\ \ \ \ \ \ \ \ lappend\ out\ \$str\n\ \ \ \ #\ there\ is\ no\ separator\ anymore,\ but\ keep\ in\ mind\ the\ right\ part\ must\ be\n----\n\n\[escargo\]:\ So\ what\ should\ you\ use\ when\ you\ don't\ care\ how\ many\ spaces\ were\nSo\ what\ should\ you\ use\ when\ you\ don't\ care\ how\ many\ spaces\ were\ between\ tokens,\nyou\ just\ want\ the\ nonblank\ tokens\ in\ the\ list\ and\ none\ of\ the\ separators?\n''--\ \[escargo\]''\n\[RS\]:\ Easy,\ just\ use\ a\ filter:\n\n\ proc\ filter\ \{cond\ list\}\ \{\n\ \ \ \ set\ res\ \{\}\n\ \ \ \ foreach\ element\ \$list\ \{if\ \[\$cond\ \$element\]\ \{lappend\ res\ \$element\}\}\n\ \ \ \ set\ res\n\ \}\n\ %\ filter\ llength\ \[split\ \"a\ \ \ list\ \ \ with\ many\ \ \ spaces\"\]\n\ a\ list\ with\ many\ spaces\n...\ or\ use\n\n\ %\ split\ \[regsub\ -all\ \{\[\ \\t\\n\]+\}\ \"a\ \ \ list\ \ \ with\ many\ \ \ spaces\"\ \{\ \}\]\ \n\n...\ or\ use\ \n\n\ %\ lreplace\ \"a\ \ \ list\ \ \ with\ many\ \ \ spaces\"\ 0\ -1\n\n\n----\nSee\ \[Counting\ characters\ in\ a\ string\]\ where\ \[split\]\ was\ pretty\ good...\n----\nKaitzschu\ mentions,\ on\ \[comp.lang.tcl\],\ this\ piece\ of\ info\ \nwhich\ is\ supposedly\ somewhere\ in\ the\ man\ pages:\n\n\"If\ splitChars\ is\ an\ empty\ string\ then\ each\ character\ of\ string\ \nbecomes\ a\ separate\ element\ of\ the\ result\ list.\"\ \n======\nThus,\ \n\n\ set\ l\ \[split\ \{abcdefghijklmnopqrstuvwxyz\}\ \{\}\]\n\nresults\ in\ a\ list\ where\ each\ character\ is\ turned\ into\ a\ separate\ list\ entry.\n----\nSee\ also\ the\ man\ page\ at\ http://www.purl.org/tcl/home/man/tcl8.4/TclCmd/split.htm\ .\n----\n\nSee\ also:\ \n\ \ \ *\ \[join\]\n\ \ \ *\ \[list\]\n\ \ \ *\ \[Splitting\ strings\ with\ embedded\ strings\]\ \n----\n\[Arts\ and\ crafts\ of\ Tcl-Tk\ programming\]\ \n\n\[Tcl\ syntax\ help\]\ -\ \n\[Category\ Command\]\ -\n\[Category\ String\ Processing\]} CALL {my revision split} CALL {::oo::Obj1528159 process revision/split} CALL {::oo::Obj1528157 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