Beginner in coroutines, sorry.
Is there a rationale, why yield call takes one argument and yieldto
takes multiple arguments?
proc cp {} {
puts "<[yield y1]>"
puts "<[yieldto string cat y2]>"
return
}
% coroutine ct cp
y1
% ct "in 1"
<in 1>
y2
% ct "in 2" "in 3"
<{in 2} {in 3}>
On the outside (e.g. usage side) of the coroutine, I find this quite strange, that once, only one argument is permitted, while otherwise,
there are multiple arguments. Why isn't this the same for yield and
yieldto?
Thanks for all,
Harald
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 1,071 |
Nodes: | 10 (0 / 10) |
Uptime: | 94:40:38 |
Calls: | 13,756 |
Calls today: | 2 |
Files: | 186,984 |
D/L today: |
10,241 files (2,823M bytes) |
Messages: | 2,426,321 |