I've consolidated all the discussion into one reply:
>> The perldocs call them "Five specially named code blocks", The Camel
names them individually (e.g. BEGIN block). How about phase blocks? They
control in what phase of compilation/runtime the code runs in.
>> I don't know, "phase" sounds too specific to me. Does the catching of an
exception really bring us into a new phase of execution? What about the LAST time through a
loop? etc.
An exception is certainly a phase-change. Last time through a loop?
Well, context anyway, if not phase, unless phase means "stage" in this
instance. Hmm, I'm starting to talk like Larry. Bad John.
>> Well, lessee. The Common Lisp spec calls them "situations" in the
definition of (eval-when)...
Good pointer, not just for the name candidate, but to look at another
formal spec to help clear up details. If they've already been thought
out, steal it.
>> It looks like they already have a name in S04: Closure traits
>> >> I don't know, it seems like any value might happen to both be a
closure and have traits, which aren't necessarily these particular ones...
My feeling exactly.
>> >> As I read it, the original question was about the actual keyword
- e.g. the word "BEGIN" - as distinct from the block it's attached to.
Though I agree we need a general term for the latter, the name "event
block" seems to imply that "BEGIN" et al are events, which might be ok
or might cause confusion with more thoroughly event-driven programming
models.
>> >> >> Hmm, maybe "control event blocks" and "control events", then...
>> How about Control Closure then?
>> syntactically speaking,
http://svn.pugscode.org/pugs/src/perl6/STD.pm groups them in
<statement_control>, just like 'if' and 'for'. semantically speaking, i
don't have a clever or unique name for them, other than what larry has
already come up with.
>> It's a really good question ... But I pretty certain we should be
using the term "block" here instead, ... people are already used to
saying "BEGIN block" and such.
And "traits" is also problematic; it says what they are, but not really
what they do.
... So I think perhaps the best term for them might be something more
like "event blocks", blocks that are called if and when a particular
event happens. That's a more user-oriented definition.
OK, so people already want to say "The BEGIN block". So the set of them
are "The XXX blocks" where XXX is the collective name for those keywords.
Beware of these words as they already convey meaning or connotation:
event trait ... ?
Perhaps the concept of "phase"/"stage" needs to be described in detail
as well, in and of itself. Then the same term can be used.
In C++ there are "phases of translation" (or is it "stages"?). We
already refer to compile-time vs run-time, sometimes CHECK time etc. so
we need a name for that semantic category. Cue the thesaurus...
"episode" makes my short list. An incident in the course of a series of
events... an incident within a narrative usually fully developed and
either integrated within the main story or digressing from it. An
intermediate or digressive passage. A portion of a narrative that
relates an event or a series of connected events and forms a coherent
story in itself. A passage between statements of a main subject or
theme, as in a rondo or fugue.
Those all have allegories with the work of the Perl implementation.
CATCH relates an event and forms a coherent story in itself. BEGIN,
CHECK, INIT etc may be portions of the overall series of events, or
chapters if you will. But a block that is written among the lines of
the main code but put elsewhere for execution is "a passage between
statements of a main subject."
"exigency" is interesting, but hang on to that for exception handling
and continuations.
--John