Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 27 |
Nodes: | 6 (0 / 6) |
Uptime: | 46:39:20 |
Calls: | 632 |
Calls today: | 3 |
Files: | 1,187 |
D/L today: |
24 files (29,813K bytes) |
Messages: | 176,485 |
Beginner in coroutines, sorry.
Is there a rationale, why yield call takes one argument and yieldto
takes multiple arguments?
proc cp {} {
-a-a-a puts "<[yield y1]>"
-a-a-a puts "<[yieldto string cat y2]>"
-a-a-a 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