First page
Back
Continue
Last page
Overview
Image
8.6 Control Structures – NRE
Miguel’s NRE (Non-Recursive Engine) – Decouples Tcl and C stacks from each other. Enables:
[328][396] coroutine, yield, yieldto
Use cases:
Implementation of event-driven protocols with straight-line code. Event handling is hidden. Use
[info coroutine]
as callback to reschedule after yielding.
https://core.tcl-lang.org/tcllib/doc/trunk/embedded/www/toc.html#coroutine
Simulation, independent agents with private state
Generators. Iterators.
https://core.tcl-lang.org/tcllib/doc/trunk/embedded/www/toc.html#generator
http://wiki.tcl-lang.org/39712