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 egavilan
1 days ago
tcl by bch
7 days ago
tcl by Bradipo
7 days ago
tcl by aspect
7 days ago
tcl by Bradipo
7 days ago
tcl by Bradipo
7 days ago
tcl by Bradipo
7 days ago
lilypond by Bradipo
8 days ago
tcl by cgm
18 days ago
tcl by dandyn
27 days ago
Submit
New paste
Documentation
From Jabber