On Thu, Sep 18, 2008 at 09:23:50AM +0200, Allison Randal wrote: >> >> What's the language-agnostic term for this, then? > > Well, 'gather' is basically a clever use of a coroutine, and 'take' is > basically a 'yield'. But, what's unique about the construct is that it > aggregates the results. So, 'gather' is an "aggregating coroutine" and > 'take' is an "aggregating yield".
It's also a little unique that the "take/yield" can happen from called subs deep within the coroutine, and doesn't have to occur within the coroutine itself. > To allow for a distinction in the > control exception types, call it 'CONTROL_YIELD_AGGREGATE'. > > "Aggregating coroutine" and "aggregating yield" aren't nearly as zippy > as 'gather' and 'take', but they're more meaningful to a broader > audience, which may help the feature spread. I'm rather hoping and expecting that "gather" and "take" become the meaningful names for this feature, much like "grep" started out as a Unix shell command but is now the language-agnostic term for "extract things from a list matching a pattern". Pm