Tcl Library Source Code

Check-in [3bea76f022]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:coroutine properly quote coroutine name
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 3bea76f0226e5c8bde209abe99af42d3c85d469a09966df9953a1b0685e40a7e
User & Date: pooryorick 2019-04-26 12:43:07
Context
2019-04-29
10:04
Make sha module compatible with channels that issue only one event each time the end of the channel is reached. check-in: aa67a2cdc0 user: pooryorick tags: trunk
2019-04-26
12:43
coroutine properly quote coroutine name check-in: 3bea76f022 user: pooryorick tags: trunk
2019-04-23
19:46
Add a new package "quasirandom" for generating quasirandom numbers check-in: 8fdd9b5200 user: arjenmarkus tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to modules/coroutine/coroutine.tcl.

    94     94       }
    95     95       tailcall {*}$cmd
    96     96   }
    97     97   
    98     98   # - -- --- ----- -------- -------------
    99     99   
   100    100   proc ::coroutine::util::after {delay} {
   101         -    ::after $delay [info coroutine]
          101  +    ::after $delay [list [info coroutine]]
   102    102       yield
   103    103       return
   104    104   }
   105    105   
   106    106   # - -- --- ----- -------- -------------
   107    107   
   108    108   proc ::coroutine::util::exit {{status 0}} {
................................................................................
   125    125       # Step 2. To prevent the next section of the coroutine code from
   126    126       # running entirely within the variable trace (*) we now use an
   127    127       # idle handler to defer it until the trace is definitely
   128    128       # done. This trick by Peter Spjuth.
   129    129       #
   130    130       # (*) At this point we are in VWaitTrace running the coroutine.
   131    131   
   132         -    ::after idle [info coroutine]
          132  +    ::after idle [list [info coroutine]]
   133    133       yield
   134    134       return
   135    135   }
   136    136   
   137    137   proc ::coroutine::util::VWaitTrace {coroutine args} {
   138    138       $coroutine
   139    139       return
   140    140   }
   141    141   
   142    142   # - -- --- ----- -------- -------------
   143    143   
   144    144   proc ::coroutine::util::update {{what {}}} {
   145    145       if {$what eq "idletasks"} {
   146         -        ::after idle [info coroutine]
          146  +        ::after idle [list [info coroutine]]
   147    147       } elseif {$what ne {}} {
   148    148           # Force proper error message for bad call.
   149    149           tailcall ::tcl::update $what
   150    150       } else {
   151         -        ::after 0 [info coroutine]
          151  +        ::after 0 [list [info coroutine]]
   152    152       }
   153    153       yield
   154    154       return
   155    155   }
   156    156   
   157    157   # - -- --- ----- -------- -------------
   158    158   
................................................................................
   376    376       # Step 2. To prevent the next section of the coroutine code from
   377    377       # running entirely within the variable trace (*) we now use an
   378    378       # idle handler to defer it until the trace is definitely
   379    379       # done. This trick by Peter Spjuth.
   380    380       #
   381    381       # (*) At this point we are in AWaitSignal running the coroutine.
   382    382   
   383         -    ::after idle [info coroutine]
          383  +    ::after idle [list [info coroutine]]
   384    384       yield
   385    385   
   386    386       return $choice
   387    387   }
   388    388   
   389    389   proc ::coroutine::util::AWaitSignal {coroutine var index op} {
   390    390       if {$op ne "write"} { return }