develooper Front page | perl.perl6.language | Postings from May 2005

Re: junctions vs English negatives.

Thread Previous | Thread Next
From:
Rod Adams
Date:
May 14, 2005 11:09
Subject:
Re: junctions vs English negatives.
Message ID:
42863EC0.9050809@rodadams.net
Larry Wall wrote:

>We have a bit of a problem with negative operators applied to junctions,
>as illustrated recently on PerlMonks.  To wit, when a native English 
>speaker writes
>
>    if $a != 1 | 2 | 3 {...}
>
>they really mean one of:
>
>    if not $a == 1 | 2 | 3 {...}
>    if $a == none(1, 2, 3) {...}
>
>or, expressed in current understanding of negated ops:
>
>    if $a != 1 & 2 & 3 {...}
>    if $a != all(1, 2, 3) {...}
>
>They specifically do *not* mean
>
>    if $a != any(1,2,3) {...}
>
>since that would always be true.
>  
>
unless $a = none(1,2)

>I don't think we can allow this situation to stand.  Either we have
>to make != and !~ and ne transform themselves via "not raising", or
>we have to disallow negative comparisons on junctions entirely.
>
>Opinions?
>  
>
I go with option 2b: leave the syntax the way it is, but fire off a 
warning, not an error when someone does this.

-- Rod Adams



Thread Previous | Thread Next


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