List Info

Thread: minor assertions improvements




minor assertions improvements
user name
2007-05-30 20:47:15
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

  
Re: minor assertions improvements
user name
2007-05-31 07:12:06
On 31/05/07, Ricardo SIGNES wrote:
> 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.

Thanks, applied.

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )