Re: contains booboo

2018-12-19 Thread Ralph Mellor
On Wed, Dec 19, 2018 at 7:58 AM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > In the mean time, I will ue if $x.contains("b") && not $x.contains( "q" ) > On 12/18/18 4:13 PM, Ralph Mellor wrote, demonstrating he never misses > anything: > > $x.contains("b") && not $x.contains("q

Re: contains booboo

2018-12-19 Thread Peter Pentchev
On Wed, Dec 19, 2018 at 04:14:37AM -0800, ToddAndMargo via perl6-users wrote: > > > Le mer. 19 déc. 2018 à 08:57, ToddAndMargo via perl6-users > > > mailto:perl6-us...@perl.org>> a écrit : > > > > > > >> On Tue, Dec 18, 2018 at 10:49 PM ToddAndMargo via perl6-users > > > >> mailto:perl6-

Re: contains booboo

2018-12-19 Thread ToddAndMargo via perl6-users
Le mer. 19 déc. 2018 à 08:57, ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> a écrit : >> On Tue, Dec 18, 2018 at 10:49 PM ToddAndMargo via perl6-users >> mailto:perl6-us...@perl.org> >> wrote: >> >>

Re: contains booboo

2018-12-19 Thread Laurent Rosenfeld via perl6-users
Hi Todd, first, please don't mix up the && Boolean operator and infix &, an *all* junction operator. Also consider the difference between the following code snippets: > my$x="abcd"; if $x.contains(not "e") {say "y"}else{say "n"}; n > my$x="abcd"; if $x.contains(none "e") {say "y"}else{say "n"};

Re: contains booboo

2018-12-18 Thread ToddAndMargo via perl6-users
On Tue, Dec 18, 2018 at 10:49 PM ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: Hi All, Where is my booboo? $ p6 'my$x="abcd"; if $x.contains("b" && not "q") {say "y"}else{say "n"};' n In the mean time, I will ue if $x.contains("b") && no

Re: contains booboo

2018-12-18 Thread Ralph Mellor
.contains tests whether its invocant, treated as a string, contains its argument, treated as a string. The argument you've given to .contains is: "b" && not "q". That's not a string. Here's one option: my$x="abcd"; if $x.contains("b") && not $x.contains("q") {say "y"}else{say "n"}; On Tue, De

contains booboo

2018-12-18 Thread ToddAndMargo via perl6-users
Hi All, Where is my booboo? $ p6 'my$x="abcd"; if $x.contains("b" && not "q") {say "y"}else{say "n"};' n In the mean time, I will ue if $x.contains("b") && not $x.contains( "q" ) Many thanks, -T -- ~~ When you say, "I wrote a program that crashed Win