Allen Wirfs-Brock wrote:
Also, I find some of these questions seem simpler to reason about I think in terms of an iterator with 'next', 'throw' and 'return' methods rather than a generator and its various internal states.
The loop forms are "external iteration" (http://esdiscuss.org/topic/generators-vs-foreach) and any throw or return within the body should not propagate a useful value to the generator implementation of the iterator (if any). The contract is based only on .next().
Reifying control effects as exceptions or implicitly invoked methods needs a strong rationale. Implicit is worse than explicit. Now is not the time to invent without extant use cases.
/be _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss