Error processing request
Parameters
CONTENT_LENGTH | 0 |
REQUEST_METHOD | GET |
REQUEST_URI | /revision/modify+a+proc%27s+behavior+with+a+shim?V=6 |
QUERY_STRING | V=6 |
CONTENT_TYPE | |
DOCUMENT_URI | /revision/modify+a+proc's+behavior+with+a+shim |
DOCUMENT_ROOT | /var/www/nikit/nikit/nginx/../docroot |
SCGI | 1 |
SERVER_PROTOCOL | HTTP/1.1 |
HTTPS | on |
REMOTE_ADDR | 172.70.126.60 |
REMOTE_PORT | 53050 |
SERVER_PORT | 4443 |
SERVER_NAME | wiki.tcl-lang.org |
HTTP_HOST | wiki.tcl-lang.org |
HTTP_CONNECTION | Keep-Alive |
HTTP_ACCEPT_ENCODING | gzip, br |
HTTP_X_FORWARDED_FOR | 3.14.132.235 |
HTTP_CF_RAY | 88cc9e53edc8e10c-ORD |
HTTP_X_FORWARDED_PROTO | https |
HTTP_CF_VISITOR | {"scheme":"https"} |
HTTP_ACCEPT | */* |
HTTP_USER_AGENT | Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected]) |
HTTP_REFERER | https://wiki.tcl.tk/revision/modify+a+proc%27s+behavior+with+a+shim?V=6 |
HTTP_CF_CONNECTING_IP | 3.14.132.235 |
HTTP_CDN_LOOP | cloudflare |
HTTP_CF_IPCOUNTRY | US |
Body
Error
Unknow state transition: LINE -> END
-code
1
-level
0
-errorstack
INNER {returnImm {Unknow state transition: LINE -> END} {}} CALL {my render_wikit {modify a proc's behavior with a shim} {[JBR] 2010-07-12
I have a lot of code that writes code. Sometimes the "standard" code that gets written from the config files is not exactly the right thing for some specific case. When this happens I usually modify the standard proc by wrapping a "shim" around it. This little bit of code makes this less crappy. It is less general than the code in [stacking] but works for me.
======
proc shim:shift { name } {
if { [info commands ${name}_shimmed] ne {} } { shim:shift ${name}_shimmed }
rename $name ${name}_shimmed
}
proc shim { name args body } {
shim:shift $name
proc $name $args $body
}
proc shim:next { args } { tailcall [lindex [info level -1] 0]_shimmed {*}$args }
======
Found another version of shim:next even more like [stacking]. Fixed up to use try instead of catch.
proc shim:next { name args } {
set level -1
try {
while { ![regexp "^${name}(_shimmed)*" [lindex [info level $level] 0]] } { incr level -1 }
} on error message {
error "cannot locate shim: $name"
}
[lindex [info level $level] 0]_shimmed {*}$args
}
======
I broke this categories thing but I cannot figure out why. It looked nice before I edited the page but not now. Sorry. The page mode seems stuck in a code block.
<<categories>>Enter Category Here} regexp2} CALL {my render {modify a proc's behavior with a shim} {[JBR] 2010-07-12
I have a lot of code that writes code. Sometimes the "standard" code that gets written from the config files is not exactly the right thing for some specific case. When this happens I usually modify the standard proc by wrapping a "shim" around it. This little bit of code makes this less crappy. It is less general than the code in [stacking] but works for me.
======
proc shim:shift { name } {
if { [info commands ${name}_shimmed] ne {} } { shim:shift ${name}_shimmed }
rename $name ${name}_shimmed
}
proc shim { name args body } {
shim:shift $name
proc $name $args $body
}
proc shim:next { args } { tailcall [lindex [info level -1] 0]_shimmed {*}$args }
======
Found another version of shim:next even more like [stacking]. Fixed up to use try instead of catch.
proc shim:next { name args } {
set level -1
try {
while { ![regexp "^${name}(_shimmed)*" [lindex [info level $level] 0]] } { incr level -1 }
} on error message {
error "cannot locate shim: $name"
}
[lindex [info level $level] 0]_shimmed {*}$args
}
======
I broke this categories thing but I cannot figure out why. It looked nice before I edited the page but not now. Sorry. The page mode seems stuck in a code block.
<<categories>>Enter Category Here}} CALL {my revision {modify a proc's behavior with a shim}} CALL {::oo::Obj82088 process revision/modify+a+proc%27s+behavior+with+a+shim} CALL {::oo::Obj82086 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