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 18, 2003 10:24
Subject:
Re: Did the assertion patch/feature submission get overlooked?
Message ID:
3E52885D.5060903@yahoo.com
Hi

>> Yes but if you've said "use assertions qw/destructors layerIII/" and
>> then -Adestructors, your assertions won't be asserted. No ? I just feel
>> that the interface is not very flexible.
> 
> 
> yes, I agree, but I didn't want to create a mini language for assertions 
>  in order to keep it simple. Maybe it is the way to go and you should be 
> able to use something like
> 
>   use assertions '(This && (is || my) || assertion) && filter'

I have implemented it, well formed logical expressions composed of '&&', 
'||', '(', ')', '1', '0' and keywords can be used.

   use assertions 'foo && bar';
   use assertions 1;
   use assertions '(foo && bar) || (foo1 || bar1 && foo2)';

And the old fashion implicit 'and' is still available

   use assertions qw|foo bar|;


I have also substituted the ugly '&' hack to use the current status in 
the selection for '_'

   use assertions 'foo';
   use assertions '_ && bar';

is equivalent to

   use assertions 'foo && bar';

so you can use '_' in any place inside the logical expressions.


Finally, I have also changed '-A' switch to insert '.*' when used alone.

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