|
From: Joe E. <jen...@fl...> - 2008-08-28 20:40:22
|
Lars Hellstrom wrote: > Neil Madden skrev: > > That state also changes every time the > > coroutine is invoked. The fact that coroutines automatically clean-up > > the command when they are "exhausted" also seems to reduce any > > difficulties with an opaque naming scheme. Creating uniquely-named > > coroutines in a special namespace (such as on the wiki page I linked > > above) will be mostly good enough. The case it misses is where a > > coroutine is created and then discarded before it has been allowed to > > run to completion. In this case an explicit clean-up would be needed. > > It's certainly possible to live with, but I can't help finding the need > for this temporary command rather ugly. Then again, I find most APIs > that create objects to keep track of pure data ugly too. As noted earlier, active coroutines have state; therefore their string rep must be a handle, not a value. And since the main thing you can do with an active coroutine is call it, using a Tcl command name for the handle seems eminently sensible to me. --Joe English jen...@fl... |