Will there be a way to achieve what the Carp module does in perl 6? I
like the functionality it gives me, but think that it should be
builtin. Perhaps it could work like this:

  caller.throw('an error');

Could this:

  throw('an error');

just be another way to say:

  $?BLOCK.throw('an error');

?

The mechanism Carp has for throwing exceptions from further down the
call stack seems a bit clunky. The above would mean we could do:

  (caller Method, :skip(2)).throw('an error');

and possibly

  # use a closure to search back through the call stack
  throw_from({.package !~ $OUTER::?package}, 'an error');

Does this make any sense? Apologies if any of this has been discussed before.

Tom

Reply via email to