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

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

From:
Salvador Fandiño
Date:
February 17, 2003 12:36
Subject:
Re: Did the assertion patch/feature submission get overlooked?
Message ID:
3E5155D5.8040503@yahoo.com
Hi,

 > > 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.

if no keys are passed the current package name is used as the filter key.

Other unresolved issue is what to do with assertions appearing before 
any "use assertions" declaration, maybe to print a warning?


 > 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).

well, I have found that it's more useful to have 'and' selection than 
'or' selection as this allows to mantain several orthogonal criterions. 
i.e., if you have an application with different layers you can use the 
layer names as one criterion and object life-cicle can be other 
criterium (contructors, destructors, storing, etc). When you debug the 
app. it is possible you would like to see the destructors for layer III, 
but not all the destructors calls and all the layer III calls at the 
same time.


Bye,

   - Salva




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