Okay, here's my first swing at improving the default core
implementation of
assertions.
1. assertions.pm says "if the entry in {^ASSERTING} is ref-eq-Regexp, match
it; otherwise, call the 'check' method on it"
The patch uses re::is_regexp instead of ref eq, and
calls the non-regex
values as subrefs. This is a smidge closer to using ~~,
which is probably
what a non-back-compat matcher would do.
2. makes assertions::activate pass non-regex refs through
unaltered, rather
than stringifying and qr//-wrapping them; this meant
that the "as object"
assertions could never be activated with the core
activator
3. tests the above
I think there's a long way to go to make these great, but I
think that making
things more ~~-compatible will help with future improved
assertions
implementations.
--
rjbs
|