On Tue, Sep 16, 2008 at 11:45:17PM +0200, Allison Randal wrote: > Patrick R. Michaud wrote: >>>>> What's TAKE? >>>> TAKE is like CONTROL_RETURN except that it signals that we expect >>>> execution to continue after the point of the TAKE. It's quite >>>> similar to a .yield operation for coroutines. >>> Would CONTROL_YIELD make more sense? I would have known what yield meant. >> >> It might be a bit misleading, because it doesn't actually correspond >> to a .yield (and thus I can envision CONTROL_YIELD as yet another >> exception type). > > Eventually we'll need to stop defining exception types as a global enum, > and let individual languages define their own. EXCEPTION_TAKE really > doesn't make sense for anything other than Perl 6. Not today, but > someday.
I'm not sure about this last comment -- I think I can imagine that other language implementations (including new ones we haven't thought of yet but suddenly becomes possible with Parrot) might want to make use of gather/take semantics if they're readily available -- especially because they can be very hard to otherwise implement when they're not readily available. And compile-time constants are pretty cheap. :-) In particular, having gather/take readily available may make it easier to implement many internal functions and libraries, even if gather/take itself isn't directly exposed at the HLL layer. Similar arguments probably hold for other "core" features of Parrot. So, I think we can't always say "oh, only one dynamic language needs this feature so it shouldn't be global" -- we need to also consider those dynamic-languages-yet-to-be-written because Parrot is such an incredible platform for creating them. Pm