Still more on generators for Bradipo
Posted to
tcl
by kbk at Tue Jul 28 21:00:57 GMT 2015
view raw
proc
worker {a} {
set
i 0
set
b [yield]
while
{1} {
set
b [yield [
expr
{
$a
* [
incr
i] *
$b
}]]
}
}
coroutine fred worker 2
puts
[fred 3]
puts
[fred 5]
puts
[fred 5]
Recent Posts
tcl by oldlaptop
12 days ago
tcl by mookie
18 days ago
tcl by dandyn
25 days ago
tcl by Bradipo
25 days ago
tcl by Bradipo
25 days ago
tcl by oldlaptop
50 days ago
tcl by oldlaptop
50 days ago
tcl by mookie
55 days ago
tcl by mookie
55 days ago
tcl by georgtree
56 days ago
Submit
New paste
Documentation
From Jabber