question about generators
greg at cosc.canterbury.ac.nz
Fri Aug 16 11:32:14 CEST 2002
Tim Peters wrote:
> The syntactic sugar is different in that Icon's "suspend" *implies* "every",
> but in Icon too a generator can return a result only to its immmediate
> caller (ditto in CLU).
(Presumably by "every" here you're talking about the proposed
Python "yield every", not the Icon "every".)
That's one way of thinking about it, I suppose, but it may not
be the best one for getting your head around how Icon works.
In Icon, calling, suspending and returning actually all
transfer control in the same direction -- *down* the call
stack. The only time you go *up* the call stack is when
It's confusing trying to compare two languages when simple
words like "return" can mean quite different things...
More information about the Python-list