On 27/03/17 19:11, Timo Paulssen wrote:
!"789" is just False.


On 27/03/17 18:53, ToddAndMargo wrote:
Hi All,

What am I doing wrong in my "AND not 789"?

$ perl6 -e 'my $x="abc123def456";
            my $y="123"; if $x.contains( $y & "abc" & ! "789" )
            {say "Yes"} else {say "no"};'

no

-T


On 03/27/2017 10:21 AM, Timo Paulssen wrote:
> Oh, I should have pointed out how to do what you actually meant to do:
>
> perl6 -e 'my $x = "abc123def456";
>                 my $y = "123";
>                 if $x.contains($y & "abc" & none("789")) { say "Yes" }
> else { say "No" }'
> Yes
>
> This uses a "none" junction, which takes part in the whole junction
> evaluation process, as opposed to the prefix:<!> which just negates a
> value straight-up and doesn't know it's being used inside a junction.
>
> HTH
>   - Timo
>
>


Thank you!

and `none("789")` is the opposite of `contains`?


--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to