Error processing request

Parameters

CONTENT_LENGTH0
REQUEST_METHODGET
REQUEST_URI/revision/yield?V=9
QUERY_STRINGV=9
CONTENT_TYPE
DOCUMENT_URI/revision/yield
DOCUMENT_ROOT/var/www/nikit/nikit/nginx/../docroot
SCGI1
SERVER_PROTOCOLHTTP/1.1
REMOTE_ADDR172.69.58.235
REMOTE_PORT53762
SERVER_PORT8888
SERVER_NAMEwiki.tcl-lang.org
HTTP_HOSTwiki.tcl-lang.org
HTTP_CONNECTIONKeep-Alive
HTTP_ACCEPT_ENCODINGgzip
HTTP_X_FORWARDED_FOR3.145.46.18
HTTP_CF_RAY8878a4be7e621142-ORD
HTTP_X_FORWARDED_PROTOhttp
HTTP_CF_VISITOR{"scheme":"http"}
HTTP_ACCEPT*/*
HTTP_USER_AGENTMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])
HTTP_CF_CONNECTING_IP3.145.46.18
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 yield {Consequence of [NRE], see [coroutine].





----
[DKF]: If you're trying to build a coroutine that yields many values, it can be a little bit tricky to work out how to string the value passing through '''yield''' nicely; the values just don't seem to pass around in a way that feels natural (well, to me anyway). Here's a helper procedure that makes it all much easier:
** Example:  Basic **
proc onetwo {} {
    set val [info coroutine]
    upvar 1 $var v
    while 1 {
        set v [yield $val]
        set val [uplevel 1 $body]
    }
}
======

With this, you get an automatic yield of the name of the coroutine to start with, and then you can pass values in and have results passed back. The given ''var''iable is set to the value passed in, and the result of evaluating the ''body'' is the next value yielded. You might use it like this:

======
proc summerBody n {
proc summerBody {n} {
        incr n $x
    }
}
coroutine s summerBody 0;   # ==> ::s
s 10;                       # ==> 10
s 5;                        # ==> 15
s 2;                        # ==> 17
s 1;                        # ==> 18
======

Without `coloop`, you'd need to write something like this:

======
proc summerBody {n} {
    set x [yield [info coroutine]]
    while 1 {
        set x [yield [incr n $x]]
    }
}
======

Which is not much longer, but ''is'' much less clear as to what value is flowing where. With longer bodies, it becomes even less clear.


----
**See Also**
   * [tcl::unsupported]::[yieldm]
} regexp2} CALL {my render yield {Consequence of [NRE], see [coroutine].





----
[DKF]: If you're trying to build a coroutine that yields many values, it can be a little bit tricky to work out how to string the value passing through '''yield''' nicely; the values just don't seem to pass around in a way that feels natural (well, to me anyway). Here's a helper procedure that makes it all much easier:
** Example:  Basic **
proc onetwo {} {
    set val [info coroutine]
    upvar 1 $var v
    while 1 {
        set v [yield $val]
        set val [uplevel 1 $body]
    }
}
======

With this, you get an automatic yield of the name of the coroutine to start with, and then you can pass values in and have results passed back. The given ''var''iable is set to the value passed in, and the result of evaluating the ''body'' is the next value yielded. You might use it like this:

======
proc summerBody n {
proc summerBody {n} {
        incr n $x
    }
}
coroutine s summerBody 0;   # ==> ::s
s 10;                       # ==> 10
s 5;                        # ==> 15
s 2;                        # ==> 17
s 1;                        # ==> 18
======

Without `coloop`, you'd need to write something like this:

======
proc summerBody {n} {
    set x [yield [info coroutine]]
    while 1 {
        set x [yield [incr n $x]]
    }
}
======

Which is not much longer, but ''is'' much less clear as to what value is flowing where. With longer bodies, it becomes even less clear.


----
**See Also**
   * [tcl::unsupported]::[yieldm]
}} CALL {my revision yield} CALL {::oo::Obj1177630 process revision/yield} CALL {::oo::Obj1177628 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