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

Re: junctions vs English negatives.

Thread Previous | Thread Next
From:
Luke Palmer
Date:
May 15, 2005 14:49
Subject:
Re: junctions vs English negatives.
Message ID:
7ca3f0160505151448348cb5e6@mail.gmail.com
On 5/14/05, Damian Conway <damian@conway.org> wrote:
> Larry wrote:
> 
> > 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?
> 
> Making them DWIM here would be a mistake, since the dwimmery would disappear
> if anyone refactored:
> 
>      if $note != $do | $re | $me {...}
> 
> to the supposedly identical:
> 
>      if $note != $do || $note != $re || $note != $me {...}
> 
> That would be a bad outcome...pedagogically as well as from a maintainability
> point-of-view.

Hmm.  I'll just that if != is implemented like this:

    multi sub infix:<!=> (Any|Junction $a, Any|Junction $b) {
        !($a == $b);
    }

Then it Just Works.

Luke

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