Anonymous user
Yahoo! search interface: Difference between revisions
m
→{{header|Tcl}}
(→Tcl: Added implementation) |
m (→{{header|Tcl}}) |
||
Line 240:
Tcl 8.6 can use its coroutine support to produce an iterator more like that Python code:
<lang tcl>proc yahoo! term {
coroutine yahoo![incr ::yahoo]
yield [info coroutine]
while 1 {
Line 247:
return -code break
}
foreach {t c u} $
yield [dict create title $t content $c url $u]
}
Line 258:
while 1 {
puts [dict get [$it] title]
after 300 ;# Slow the code down... :-)
}</lang>
|