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,089 |
| Nodes: | 10 (0 / 10) |
| Uptime: | 153:53:41 |
| Calls: | 13,921 |
| Calls today: | 2 |
| Files: | 187,021 |
| D/L today: |
3,760 files (944M bytes) |
| Messages: | 2,457,163 |