Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Carp in perl 6

11 views
Skip to first unread message

Thomas Yandell

unread,
Mar 13, 2005, 7:06:23 PM3/13/05
to perl6-l...@perl.org
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

0 new messages