The default of die is to, er, die.  You can resume after a die, but only if you 
do so explicitly, in which case you are responsible for overriding the 
expectations of whoever wrote the die and likely did not expect it to return.

> p6 'sub a($a) { $a(); CATCH { default { say "default"; .resume } }; 42 }; say 
> a( -> { die } )'
default
42

Here's the problem with that:

> p6 'sub a($a) { $a(); CATCH { default { say "default"; .resume } }; 42 }; say 
> a( -> { die unless $*INVARIANT; } )'default
42

Okay so far, but suppose we violate the invariant...

> p6 'sub a($a) { $a(); CATCH { default { say "default"; .resume } }; 42 }; say 
> a( -> { die unless $*INVARIANT; say "assume $*INVARIANT" } )'
default
default
default
This exception is not resumable
  in block  at -e:1
  in block <unit> at -e:1

So resuming is never going to be the default for die.  (That's why we have 
warn, after all.)

Reply via email to