develooper Front page | perl.perl5.porters | Postings from February 2003

Re: Did the assertion patch/feature submission get overlooked?

From:
Rafael Garcia-Suarez
Date:
February 17, 2003 06:28
Subject:
Re: Did the assertion patch/feature submission get overlooked?
Message ID:
20030217152711.74ddd9f9.rgarciasuarez@free.fr
hv@crypt.org wrote:
> :In the new version, the -A switch is used with a list of tags:
> :
> :     perl -Afoo,bar ...
> :
> :and what it really does is:
> :
> :     use assertions::activate split(/,/,{foo,bar});
> :
> :in a similar fashion to '-M' or '-d:' switches.
> 
> I think it would be useful to permit activation of all assertions,
> one way or another: perhaps with a bare -A, or perhaps with something
> like -A:all. I tried testing with:
>   perl -A'.*' -wle 'sub foo : assertion { print "assert"; } foo(); print "ok"'
> .. and the assertion was not activated.

It wasn't activated because you didn't "use assertions" at all.
And BTW I think that 'use assertions' without an import list should be
disallowed.
But I agree that having a bare -A equivalent to '-A.*' would be nice.

I have one concern :
if you say "use assertions qw/foo bar/" you need to pass -Afoo,bar to activate
the assertions in the corresponding block. I'd have expected that -Afoo and -Abar
work too (i.e. that assertion groups are or-ed, not and-ed).



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About