[snipped a bit from below]
Which brings me to `halt`.

Suggested plugin name: HaltRequest

I think this is quite nice; HaltRequest and halt(). I'll
wait a couple of days, maybe try to write some tests, to
see if there is more feedback and then give it a try.

On Mar 15, 2008, at 2:28 AM, Aristotle Pagaltzis wrote:
* Ashley <[EMAIL PROTECTED]> [2008-03-15 06:15]:
While we're on the topic. How abhorrent/stupid is this?
       $c->die();
   # or
       $c->die("Dying is easy, comedy is hard");

I'd really like something like this. I could go for $c->fatal()
too. fatal_error() is nice and descriptive but I lean toward
something shorter if it can be agreed upon.

FWIW, I based it on the feel of `error_out`.

It should convey, /somehow/, that it's circumventing further
processing excepting the end. "die" feels intuitive and is
super easy to type but it seems too loaded.

At first I was going to suggest `abort`. It’s too ambiguous tho:
the verb is both transitive and intransitive, and it’s not clear
that the latter sense is meant. Also if used transitively it’d be
unclear whether it’s like `forward`/`detach` in that it takes an
action, or if it expects a different kind of argument. It would
have to be `abort_with_msg` or something; but that’s a good deal
worse than `fatal_error`.

Then I thought of `fail`. That does not suffer from these
problems and is almost as short as `die`. It’s somewhat loaded,
though, even though in a very different way from `die`
(particularly for Perl programmers). Not every case where one
wants to abort the request processing is a failure.

That would suggest something like `stop`. But that has much the
same linguistic ambiguity problems as `abort`, if not to the same
degree (because it doesn’t have quite as many connotations in
programming as `abort`). But it says a little too little about
what is being stopped. It’s not necessarily clear that it means
stopping the request processing as opposed to stopping whatever
else one might stop.

Maybe `quit`? The problem with that is that it suggests that the
Cat app terminates altogether. Other than that it would seem like
a good candidate, because I think the connotation of quitting in
computing makes it quite clear that this wouldn’t expect an action
as an argument, say.

Which brings me to `halt`. As far as I can tell, that suffers
from none of the problems with any of the other options. It has a
strong connotation of “halt processing” in computing and it’s
very clear that it is intransitive, and unlike `fail` it doesn’t
make a strong suggestion about whether the outcome is desirable,
although it is negatively connoted.

As a bonus, it’s word you can imagine a burly German yelling.

Suggested plugin name: HaltRequest

Regards,
--
Aristotle Pagaltzis // <http://plasmasturm.org/>


_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to