Re: I need a second pair of eyes

2020-05-26 Thread ToddAndMargo via perl6-users

On 2020-05-26 19:16, ToddAndMargo via perl6-users wrote:

On 2020-05-25 23:42, ToddAndMargo via perl6-users wrote:

HI All,

I am missing something here:


154:   # figure out the label
155:   say %CommandLine;
156:   if "%CommandLine".starts-with( "[" )  &&
157:  "%CommandLine".contains( "]" ) {


BACKUP:\MyDocsBackup\backup1
Cannot resolve caller index(Str:U: Str:D); none of these signatures 
match:

 (List:D: Cool:D $needle, *%_)
 (Cool:D: Cool:D $needle, :i(:$ignorecase)!, :m(:$ignoremark), *%_ 
--> Int:D)

 (Cool:D: Cool:D $needle, :m(:$ignoremark)!, *%_ --> Int:D)
 (Cool:D: Cool:D $needle, *%_ --> Int:D)
 (Cool:D: Cool:D $needle, Cool:D $pos, :i(:$ignorecase)!, 
:m(:$ignoremark), *%_ --> Int:D)
 (Cool:D: Cool:D $needle, Cool:D $pos, :m(:$ignoremark)!, *%_ --> 
Int:D)

 (Cool:D: Cool:D $needle, Cool:D $pos, *%_ --> Int:D)
 (Str:D: Str:D $needle, :i(:$ignorecase)!, :m(:$ignoremark), *%_ 
--> Int:D)
 (Str:D: Str:D $needle, Int:D $pos, :i(:$ignorecase)!, 
:m(:$ignoremark), *%_ --> Int:D)
 (Str:D: @needles, :i(:$ignorecase)!, :m(:$ignoremark), *%_ --> 
Int:D)

 (Str:D: Str:D $needle, :m(:$ignoremark)!, *%_ --> Int:D)
 (Str:D: Str:D $needle, Int:D $pos, :m(:$ignoremark)!, *%_ --> Int:D)
 (Str:D: @needles, :m(:$ignoremark)!, *%_ --> Int:D)
 (Str:D: Str:D $needle, *%_ --> Int:D)
 (Str:D: Str:D $needle, Int:D $pos, *%_ --> Int:D)
 (Str:D: @needles, *%_ --> Int:D)
   in sub GatherOptions at CobianWrapper.pl6 line 156
   in block  at CobianWrapper.pl6 line 390



Follow up:

This turned ot the be the same issue as the other on:

say %CommandLine;
BACKUP:\MyDocsBackup\backup1

Was not the actual case.  %CommandLine
was actually blank.

I need to start using `print` instead of `say` to
proof things.

Thank you all for the help and tips!



And I replaced all my "say" with "print"


Re: I need a second pair of eyes

2020-05-26 Thread ToddAndMargo via perl6-users

On 2020-05-25 23:42, ToddAndMargo via perl6-users wrote:

HI All,

I am missing something here:


154:   # figure out the label
155:   say %CommandLine;
156:   if "%CommandLine".starts-with( "[" )  &&
157:  "%CommandLine".contains( "]" ) {


BACKUP:\MyDocsBackup\backup1
Cannot resolve caller index(Str:U: Str:D); none of these signatures match:
     (List:D: Cool:D $needle, *%_)
     (Cool:D: Cool:D $needle, :i(:$ignorecase)!, :m(:$ignoremark), *%_ 
--> Int:D)

     (Cool:D: Cool:D $needle, :m(:$ignoremark)!, *%_ --> Int:D)
     (Cool:D: Cool:D $needle, *%_ --> Int:D)
     (Cool:D: Cool:D $needle, Cool:D $pos, :i(:$ignorecase)!, 
:m(:$ignoremark), *%_ --> Int:D)
     (Cool:D: Cool:D $needle, Cool:D $pos, :m(:$ignoremark)!, *%_ --> 
Int:D)

     (Cool:D: Cool:D $needle, Cool:D $pos, *%_ --> Int:D)
     (Str:D: Str:D $needle, :i(:$ignorecase)!, :m(:$ignoremark), *%_ --> 
Int:D)
     (Str:D: Str:D $needle, Int:D $pos, :i(:$ignorecase)!, 
:m(:$ignoremark), *%_ --> Int:D)

     (Str:D: @needles, :i(:$ignorecase)!, :m(:$ignoremark), *%_ --> Int:D)
     (Str:D: Str:D $needle, :m(:$ignoremark)!, *%_ --> Int:D)
     (Str:D: Str:D $needle, Int:D $pos, :m(:$ignoremark)!, *%_ --> Int:D)
     (Str:D: @needles, :m(:$ignoremark)!, *%_ --> Int:D)
     (Str:D: Str:D $needle, *%_ --> Int:D)
     (Str:D: Str:D $needle, Int:D $pos, *%_ --> Int:D)
     (Str:D: @needles, *%_ --> Int:D)
   in sub GatherOptions at CobianWrapper.pl6 line 156
   in block  at CobianWrapper.pl6 line 390



Follow up:

This turned ot the be the same issue as the other on:

say %CommandLine;
BACKUP:\MyDocsBackup\backup1

Was not the actual case.  %CommandLine
was actually blank.

I need to start using `print` instead of `say` to
proof things.

Thank you all for the help and tips!


Re: need string is not a a string is a string help

2020-05-26 Thread ToddAndMargo via perl6-users

On 2020-05-26 17:13, ToddAndMargo via perl6-users wrote:

Hi All,

What in the dickens  Only `say  %Options;` works,
but only when it only has a single argument.


241: for split( "", %Options ) -> $y {say "$y = ", ord( $y ) };
242: for %Options.comb -> $y {say "$y = ", ord( $y ) };
243: say  %Options;
244: say ">" ~ %Options ~ "<";
245: print "-->" ~ %Options ~ "<--\n";
246: say %Options.^name;
247: say %Options.WHAT;
248: dd  %Options;
249: say %Options.ends-with( "1" );
250: say  %Options.chars;



241: & 242: no output to screen
243: A:\YourDocs\backup1
  # I did not put this blank line here
244: ><
245: --><--
246: Str
247: (Str)
248: Str %Options = ""
249: False   # DOES TOO END IN A ONE!!!
250: 0

I am so confused!

-T



Figured it out.  %Options.comb never had anything actually in it. 
Why the first "say" said it did is

beyond me.


Re: I need help testing for Nil

2020-05-26 Thread ToddAndMargo via perl6-users

On 2020-05-26 16:29, Brad Gilbert wrote:

There are various equality operators.

「==」 Tests for numeric equality
「eq」 Tests for string equality
「===」 Tests for value identity
「=:=」 Tests for pointer equality (Note that it looks a bit like 「:=」)
「eqv」 Tests for structure equivalence.

The 「==」 and 「eq」 operators are special because they force their values 
to be numbers or strings before they do anything else.


Thank you!  Wrote it down.


need string is not a a string is a string help

2020-05-26 Thread ToddAndMargo via perl6-users

Hi All,

What in the dickens  Only `say  %Options;` works,
but only when it only has a single argument.


241: for split( "", %Options ) -> $y {say "$y = ", ord( $y ) };
242: for %Options.comb -> $y {say "$y = ", ord( $y ) };
243: say  %Options;
244: say ">" ~ %Options ~ "<";
245: print "-->" ~ %Options ~ "<--\n";
246: say %Options.^name;
247: say %Options.WHAT;
248: dd  %Options;
249: say %Options.ends-with( "1" );
250: say  %Options.chars;



241: & 242: no output to screen
243: A:\YourDocs\backup1
 # I did not put this blank line here
244: ><
245: --><--
246: Str
247: (Str)
248: Str %Options = ""
249: False   # DOES TOO END IN A ONE!!!
250: 0

I am so confused!

-T


Re: Regexps using 'after' and 'before' like ^ and $

2020-05-26 Thread Joseph Brenner
Hey Brad, thanks much for the explication:

> 「」 should probably also prevent the position from being at the end.

> It does work if you write it differently

> 'abc' ~~ / b  /
> Nil

That's pretty interesting, though I can't say I understand at all
what's going on there.

> It does seem like there could be a bug here.

That was my suspicion.  I'll probably open an issue on it soon.

> All of that said, I don't think it is useful to tell new Raku programmers 
> that you can use those features that way.

Yes, certainly not.  Just to be clear, I'm just messing around
with after/before to get a better sense of what they do.

I tried to avoid saying the two forms are equivalent, they just
do roughly similar things.



On 5/26/20, Brad Gilbert  wrote:
> I'm not sure that is the best way to look at 「」 and 「」.
>
> > 'abcd123abcd' ~~ / > .+ > /
> 「123」
>
> In the above code 「>」 makes sure that the first thing that
> 「.+」 matches is a 「」
> And 「>」 makes sure that the last thing 「.+」 matches is also
> a 「」
>
> The 「>」 is written in front of the 「.+」 so it starts at
> that position
>
> It does the thing that 「」 would normally do.
>
> ' a b c d 1 2 3 a b c d '
> ' _ _ _ _^1^_ _ _ _ _ _ '
>
> The thing is, 「」 resets the position to what it was immediately
> before the successful 「」 match.
>
> ' a b c d 1 2 3 a b c d '
> ' _ _ _ _^_ _ _ _ _ _ _ '
>
> The 「.+」 then tries to grab everything
>
> ' a b c d 1 2 3 a b c d '
> ' _ _ _ _^1 2 3 a b c d^'
>
> Then  「>」 gets to tell it that it can't do that.
>
> The reason is that 「」 looks backwards from the current position. The
> current position is at the very end.
> It obviously isn't a 「」, so 「.+」 has to keep giving up characters
> until its last value is a 「」.
>
> ' a b c d 1 2 3 a b c d '
> ' _ _ _ _^1 2 3^_ _ _ _ '
>
> ---
>
> You can use 「」 to check that is at the beginning.
>
>  'abc' ~~ /  b /
>  Nil
>
> The reason is that if the current position is anywhere other than the
> beginning 「.」 would match.
> Since we used 「!」 that won't fly.
>
> 「」 should probably also prevent the position from being at the
> end.
>
> It does work if you write it differently
>
> 'abc' ~~ / b  /
> Nil
>
> Note that 「」 and 「」 are really just function calls.
>
> It does seem like there could be a bug here.
>
> ---
>
> All of that said, I don't think it is useful to tell new Raku programmers
> that you can use those features that way.
>
> It make them think that these two regexes are doing something similar.
>
> / ^ ... /
> /  ... /
>
> They match the same three characters, but for entirely different reasons.
>
> The 「^」 version is basically the same as:
>
> /  ... /
>
> While the other one is something like:
>
> /  ... /
>
> (The 「try」 is needed because 「.substr( -1 )」 is a Failure.)
>
> So then these:
>
> / ... $ /
> / ... 
>
> Would be
>
> / ...  /
> / ...  /
>
> ---
>
> What I think is happening is that the 「」 works because the
> 「.substr( -1, 1)」 creates a Failure.
>
> The thing is that 「'abc'.substr( 3, 1 )」 doesn't create a Failure, it just
> gives you an empty Str.
>
> (The second argument is the maximum number of characters to return.)
>
> On Mon, May 25, 2020 at 4:10 PM Joseph Brenner  wrote:
>
>> Given this string:
>>my $str = "Romp romp ROMP";
>>
>> We can match just the first or last by using the usual pinning
>> features, '^' or '$':
>>
>>say $str ~~ m:i:g/^romp/;   ## (「Romp」)
>>say $str ~~ m:i:g/romp$/;   ## (「ROMP」)
>>
>> Moritz Lenz (Section 3.8 of 'Parsing', p32) makes the point you
>> can use 'after' to do something like '^' pinning:
>>
>>say $str ~~ m:i:g/  romp /;   ## (「Romp」)
>>
>> That makes sense:  the BOL is "not after any character"
>> So: I wondered if there was a way to use 'before' to do
>> something like '$' pinning:
>>
>>   say $str ~~ m:i:g/ romp  /;  ## (「Romp」 「romp」)
>>
>> That was unexpected: it filters out the one I was trying to
>> match for, though the logic seemed reasonable: the EOL is "not
>> before any character".
>>
>> What if we flip this and do a positive before match?
>>
>>   say $str ~~ m:i:g/ romp  /;  ## (「Romp」 「romp」)
>>
>> That does exactly the same thing, but here the logic makes
>> sense to me: the first two are "before some character",
>> but the last one isn't.
>>
>


Re: I need help testing for Nil

2020-05-26 Thread Brad Gilbert
There are various equality operators.

「==」 Tests for numeric equality
「eq」 Tests for string equality
「===」 Tests for value identity
「=:=」 Tests for pointer equality (Note that it looks a bit like 「:=」)
「eqv」 Tests for structure equivalence.

The 「==」 and 「eq」 operators are special because they force their values to
be numbers or strings before they do anything else.

There are similarly a variety of comparison operators.

On Tue, May 26, 2020 at 5:06 PM ToddAndMargo via perl6-users <
perl6-us...@perl.org> wrote:

> >> On Tue, May 26, 2020 at 4:24 PM ToddAndMargo via perl6-users
> >> mailto:perl6-us...@perl.org>> wrote:
> >>
> >> Hi All,
> >>
> >> How do I turn this:
> >>
> >> $ raku -e 'my $x="abc"; say $x.index( "q" );'
> >> Nil
> >>
> >> into a test?
> >>
> >> $ raku -e 'my $x="abc"; if $x.index( "q" ) eq Nil {say
> "Nil"}else{say
> >> "Exists";}'
> >> Use of Nil in string context
> >> in block  at -e line 1
> >> Use of Nil in string context
> >> in block  at -e line 1
> >> Nil
> >>
> >>
> >> Many thanks,
> >> -T
> >>
>
> On 2020-05-26 15:00, Brad Gilbert wrote:
> > Generally you don't need to test for 「Nil」.
> > You can just test for defined-ness.
>
> True enough
>
> >
> >  $ raku -e 'my $x="abc"; with $x.index( "q" ) {say "Exists"} else
> > {say "Nil";}'
> >
> > Also 「Nil」 is not a 「Str」, so why would you use 「eq」?
>
> Because == did not work
>
>
> >  $ raku -e 'Nil.Str'
> >  Use of Nil in string context
> >
> > If you really need to check specifically for 「Nil」 (which you probably
> > don't), then you can use 「===」.
> >
> >  for Str, Int, Nil {
> >  say 'Nil' if $_ === Nil;
> >  }
> >
> > The 「//」 operator can also be useful to deal with undefined values such
> > as 「Nil」.
> >
> >  my $x = 'abc';
> >  say $x.index('q') // 'cannot find the index of 「q」';
> >
> >
>
> Hi Brad,
>
> Did not know about the triple =
>
> Thank you!
>
> -T
>
>
> $ raku -e 'my $x="abc"; if $x.index( "q" ) === Nil {say "Nil"}else{say
> "Exists";}'
> Nil
>
> $ raku -e 'my $x="abc"; if $x.index( "a" ) === Nil {say "Nil"}else{say
> "Exists";}'
> Exists
>
> And I found buried in my Nil notes that `=:=` works too
>
> $ raku -e 'my $x="abc"; if $x.index( "q" ) =:= Nil {say "Nil"}else{say
> "Exists";}'
> Nil
>
> $ raku -e 'my $x="abc"; if $x.index( "b" ) =:= Nil {say "Nil"}else{say
> "Exists";}'
> Exists
>


Re: Regexps using 'after' and 'before' like ^ and $

2020-05-26 Thread Brad Gilbert
I'm not sure that is the best way to look at 「」 and 「」.

> 'abcd123abcd' ~~ / > .+ > /
「123」

In the above code 「>」 makes sure that the first thing that
「.+」 matches is a 「」
And 「>」 makes sure that the last thing 「.+」 matches is also
a 「」

The 「>」 is written in front of the 「.+」 so it starts at
that position

It does the thing that 「」 would normally do.

' a b c d 1 2 3 a b c d '
' _ _ _ _^1^_ _ _ _ _ _ '

The thing is, 「」 resets the position to what it was immediately
before the successful 「」 match.

' a b c d 1 2 3 a b c d '
' _ _ _ _^_ _ _ _ _ _ _ '

The 「.+」 then tries to grab everything

' a b c d 1 2 3 a b c d '
' _ _ _ _^1 2 3 a b c d^'

Then  「>」 gets to tell it that it can't do that.

The reason is that 「」 looks backwards from the current position. The
current position is at the very end.
It obviously isn't a 「」, so 「.+」 has to keep giving up characters
until its last value is a 「」.

' a b c d 1 2 3 a b c d '
' _ _ _ _^1 2 3^_ _ _ _ '

---

You can use 「」 to check that is at the beginning.

 'abc' ~~ /  b /
 Nil

The reason is that if the current position is anywhere other than the
beginning 「.」 would match.
Since we used 「!」 that won't fly.

「」 should probably also prevent the position from being at the
end.

It does work if you write it differently

'abc' ~~ / b  /
Nil

Note that 「」 and 「」 are really just function calls.

It does seem like there could be a bug here.

---

All of that said, I don't think it is useful to tell new Raku programmers
that you can use those features that way.

It make them think that these two regexes are doing something similar.

/ ^ ... /
/  ... /

They match the same three characters, but for entirely different reasons.

The 「^」 version is basically the same as:

/  ... /

While the other one is something like:

/  ... /

(The 「try」 is needed because 「.substr( -1 )」 is a Failure.)

So then these:

/ ... $ /
/ ... 

Would be

/ ...  /
/ ...  /

---

What I think is happening is that the 「」 works because the
「.substr( -1, 1)」 creates a Failure.

The thing is that 「'abc'.substr( 3, 1 )」 doesn't create a Failure, it just
gives you an empty Str.

(The second argument is the maximum number of characters to return.)

On Mon, May 25, 2020 at 4:10 PM Joseph Brenner  wrote:

> Given this string:
>my $str = "Romp romp ROMP";
>
> We can match just the first or last by using the usual pinning
> features, '^' or '$':
>
>say $str ~~ m:i:g/^romp/;   ## (「Romp」)
>say $str ~~ m:i:g/romp$/;   ## (「ROMP」)
>
> Moritz Lenz (Section 3.8 of 'Parsing', p32) makes the point you
> can use 'after' to do something like '^' pinning:
>
>say $str ~~ m:i:g/  romp /;   ## (「Romp」)
>
> That makes sense:  the BOL is "not after any character"
> So: I wondered if there was a way to use 'before' to do
> something like '$' pinning:
>
>   say $str ~~ m:i:g/ romp  /;  ## (「Romp」 「romp」)
>
> That was unexpected: it filters out the one I was trying to
> match for, though the logic seemed reasonable: the EOL is "not
> before any character".
>
> What if we flip this and do a positive before match?
>
>   say $str ~~ m:i:g/ romp  /;  ## (「Romp」 「romp」)
>
> That does exactly the same thing, but here the logic makes
> sense to me: the first two are "before some character",
> but the last one isn't.
>


Re: I need a second pair of eyes

2020-05-26 Thread ToddAndMargo via perl6-users
On Tue, May 26, 2020 at 4:54 PM yary > wrote:


 From this much

158: Cannot resolve caller
index(Str:U: Str:D); none of these signatures match:

"index" is being called with the 1st arg undefined, 2nd arg defined.
There is no "index" multi handling the 1st undefined arg, is my guess.

-y


On Tue, May 26, 2020 at 4:41 AM ToddAndMargo via perl6-users
mailto:perl6-us...@perl.org>> wrote:

On 2020-05-26 01:37, ToddAndMargo via perl6-users wrote:
 > 155: A:\YourDocs\backup1
 >  156: No
 >   157: No
 >
 > 158: Cannot resolve caller
 > index(Str:U: Str:D); none of these signatures match:
 >   (List:D: Cool:D $needle, *%_)


I wonder what that was all about.  Looked fine on my screen:

155: A:\YourDocs\backup1
156: No
157: No

158: Cannot resolve caller
index(Str:U: Str:D); none of these signatures match:
...
(List:D: Cool:D $needle, *%_)
in sub GatherOptions at CobianWrapper.pl6 line 158





On 2020-05-26 15:15, Brad Gilbert wrote:

This is more of how I would structure it

     with %CommandLine {
         .say;
         # if /^ '['  .*? ']' / {
        if .starts-with('[') && .contains(']') {
             ...
         }
     } else {
         say 'no backup path given'
     }

We can skip checking 「.starts-with」 and 「.contains」 if there isn't 
anything to start with.


Hi Brad.  That got me past the error.  Thank you!


Re: I need a second pair of eyes

2020-05-26 Thread Brad Gilbert
This is more of how I would structure it

with %CommandLine {
.say;
# if /^ '['  .*? ']' / {
   if .starts-with('[') && .contains(']') {
...
}
} else {
say 'no backup path given'
}

We can skip checking 「.starts-with」 and 「.contains」 if there isn't anything
to start with.

On Tue, May 26, 2020 at 4:54 PM yary  wrote:

> From this much
>
> 158: Cannot resolve caller
> index(Str:U: Str:D); none of these signatures match:
>
> "index" is being called with the 1st arg undefined, 2nd arg defined. There
> is no "index" multi handling the 1st undefined arg, is my guess.
>
> -y
>
>
> On Tue, May 26, 2020 at 4:41 AM ToddAndMargo via perl6-users <
> perl6-us...@perl.org> wrote:
>
>> On 2020-05-26 01:37, ToddAndMargo via perl6-users wrote:
>> > 155: A:\YourDocs\backup1
>> >  156: No
>> >   157: No
>> >
>> > 158: Cannot resolve caller
>> > index(Str:U: Str:D); none of these signatures match:
>> >   (List:D: Cool:D $needle, *%_)
>>
>>
>> I wonder what that was all about.  Looked fine on my screen:
>>
>> 155: A:\YourDocs\backup1
>> 156: No
>> 157: No
>>
>> 158: Cannot resolve caller
>> index(Str:U: Str:D); none of these signatures match:
>> ...
>> (List:D: Cool:D $needle, *%_)
>> in sub GatherOptions at CobianWrapper.pl6 line 158
>>
>


Re: I need help testing for Nil

2020-05-26 Thread ToddAndMargo via perl6-users
On Tue, May 26, 2020 at 4:24 PM ToddAndMargo via perl6-users 
mailto:perl6-us...@perl.org>> wrote:


Hi All,

How do I turn this:

$ raku -e 'my $x="abc"; say $x.index( "q" );'
Nil

into a test?

$ raku -e 'my $x="abc"; if $x.index( "q" ) eq Nil {say "Nil"}else{say
"Exists";}'
Use of Nil in string context
in block  at -e line 1
Use of Nil in string context
in block  at -e line 1
Nil


Many thanks,
-T



On 2020-05-26 15:00, Brad Gilbert wrote:

Generally you don't need to test for 「Nil」.
You can just test for defined-ness.


True enough



     $ raku -e 'my $x="abc"; with $x.index( "q" ) {say "Exists"} else 
{say "Nil";}'


Also 「Nil」 is not a 「Str」, so why would you use 「eq」?


Because == did not work



     $ raku -e 'Nil.Str'
     Use of Nil in string context

If you really need to check specifically for 「Nil」 (which you probably 
don't), then you can use 「===」.


     for Str, Int, Nil {
         say 'Nil' if $_ === Nil;
     }

The 「//」 operator can also be useful to deal with undefined values such 
as 「Nil」.


     my $x = 'abc';
     say $x.index('q') // 'cannot find the index of 「q」';




Hi Brad,

Did not know about the triple =

Thank you!

-T


$ raku -e 'my $x="abc"; if $x.index( "q" ) === Nil {say "Nil"}else{say 
"Exists";}'

Nil

$ raku -e 'my $x="abc"; if $x.index( "a" ) === Nil {say "Nil"}else{say 
"Exists";}'

Exists

And I found buried in my Nil notes that `=:=` works too

$ raku -e 'my $x="abc"; if $x.index( "q" ) =:= Nil {say "Nil"}else{say 
"Exists";}'

Nil

$ raku -e 'my $x="abc"; if $x.index( "b" ) =:= Nil {say "Nil"}else{say 
"Exists";}'

Exists


Re: I need help testing for Nil

2020-05-26 Thread Brad Gilbert
Generally you don't need to test for 「Nil」.
You can just test for defined-ness.

$ raku -e 'my $x="abc"; with $x.index( "q" ) {say "Exists"} else {say
"Nil";}'

Also 「Nil」 is not a 「Str」, so why would you use 「eq」?

$ raku -e 'Nil.Str'
Use of Nil in string context

If you really need to check specifically for 「Nil」 (which you probably
don't), then you can use 「===」.

for Str, Int, Nil {
say 'Nil' if $_ === Nil;
}

The 「//」 operator can also be useful to deal with undefined values such as
「Nil」.

my $x = 'abc';
say $x.index('q') // 'cannot find the index of 「q」';


On Tue, May 26, 2020 at 4:24 PM ToddAndMargo via perl6-users <
perl6-us...@perl.org> wrote:

> Hi All,
>
> How do I turn this:
>
> $ raku -e 'my $x="abc"; say $x.index( "q" );'
> Nil
>
> into a test?
>
> $ raku -e 'my $x="abc"; if $x.index( "q" ) eq Nil {say "Nil"}else{say
> "Exists";}'
> Use of Nil in string context
>in block  at -e line 1
> Use of Nil in string context
>in block  at -e line 1
> Nil
>
>
> Many thanks,
> -T
>


Re: I need a second pair of eyes

2020-05-26 Thread yary
>From this much

158: Cannot resolve caller
index(Str:U: Str:D); none of these signatures match:

"index" is being called with the 1st arg undefined, 2nd arg defined. There
is no "index" multi handling the 1st undefined arg, is my guess.

-y


On Tue, May 26, 2020 at 4:41 AM ToddAndMargo via perl6-users <
perl6-us...@perl.org> wrote:

> On 2020-05-26 01:37, ToddAndMargo via perl6-users wrote:
> > 155: A:\YourDocs\backup1
> >  156: No
> >   157: No
> >
> > 158: Cannot resolve caller
> > index(Str:U: Str:D); none of these signatures match:
> >   (List:D: Cool:D $needle, *%_)
>
>
> I wonder what that was all about.  Looked fine on my screen:
>
> 155: A:\YourDocs\backup1
> 156: No
> 157: No
>
> 158: Cannot resolve caller
> index(Str:U: Str:D); none of these signatures match:
> ...
> (List:D: Cool:D $needle, *%_)
> in sub GatherOptions at CobianWrapper.pl6 line 158
>


Re: I need a second pair of eyes

2020-05-26 Thread ToddAndMargo via perl6-users

On 2020-05-26 01:40, ToddAndMargo via perl6-users wrote:

On 2020-05-26 01:37, ToddAndMargo via perl6-users wrote:
155: A:\YourDocs\backup1 
 156: No

  157: No

    158: Cannot resolve caller 
index(Str:U: Str:D); none of these signatures match: 
  (List:D: Cool:D $needle, *%_)



I wonder what that was all about.  Looked fine on my screen:

155: A:\YourDocs\backup1
156: No
157: No

158: Cannot resolve caller
index(Str:U: Str:D); none of these signatures match:
...
(List:D: Cool:D $needle, *%_)
in sub GatherOptions at CobianWrapper.pl6 line 158



This passes with flying colors:

#!/usr/bin/env raku
my Str $x = "abc";
if $x.starts-with( "[" )  &&
   $x.contains( "]" )
{ say "Passed"; } else { say "Failed"; }



GGGR


I need help testing for Nil

2020-05-26 Thread ToddAndMargo via perl6-users

Hi All,

How do I turn this:

$ raku -e 'my $x="abc"; say $x.index( "q" );'
Nil

into a test?

$ raku -e 'my $x="abc"; if $x.index( "q" ) eq Nil {say "Nil"}else{say 
"Exists";}'

Use of Nil in string context
  in block  at -e line 1
Use of Nil in string context
  in block  at -e line 1
Nil


Many thanks,
-T


Re: I need a second pair of eyes

2020-05-26 Thread ToddAndMargo via perl6-users

On 2020-05-26 01:37, ToddAndMargo via perl6-users wrote:
155: A:\YourDocs\backup1 
     156: No

  157: No

    158: Cannot resolve caller 
index(Str:U: Str:D); none of these signatures match: 
  (List:D: Cool:D $needle, *%_)



I wonder what that was all about.  Looked fine on my screen:

155: A:\YourDocs\backup1
156: No
157: No

158: Cannot resolve caller
index(Str:U: Str:D); none of these signatures match:
...
(List:D: Cool:D $needle, *%_)
in sub GatherOptions at CobianWrapper.pl6 line 158


Re: I need a second pair of eyes

2020-05-26 Thread ToddAndMargo via perl6-users

This is Rakudo version 2020.05.1 built on MoarVM version 2020.05
implementing Raku 6.d.

It is back at it again.  The second test, I sent it
something with brackets in it.  It is the failed test
to goes wonkers


I put some debugging and is seems that it does not like
my `&&`


155: say %CommandLine;

156: if %CommandLine.starts-with( "[" )  {say 
"Yes";}else{say "No";}


157: if %CommandLine.contains( "]" )  {say "Yes";}else{say 
"No";}


158: if %CommandLine.starts-with( "[" )  &&
  %CommandLine.contains( "]" ) {


155: A:\YourDocs\backup1 
156: No 


 157: No

   158: Cannot resolve caller 
index(Str:U: Str:D); none of these signatures match: 
 (List:D: Cool:D $needle, *%_) 



...
in sub GatherOptions at CobianWrapper.pl6 line 158


Re: I need a second pair of eyes

2020-05-26 Thread ToddAndMargo via perl6-users

> On Tue, May 26, 2020, 09:45 ToddAndMargo via perl6-users
> mailto:perl6-us...@perl.org>> wrote:
>
> HI All,
>
> I am missing something here:
>
>
> 154:   # figure out the label
> 155:   say %CommandLine;
> 156:   if "%CommandLine".starts-with( "[" )  &&
> 157:  "%CommandLine".contains( "]" ) {
>
>
> BACKUP:\MyDocsBackup\backup1
> Cannot resolve caller index(Str:U: Str:D); none of these
> signatures match:
>   (List:D: Cool:D $needle, *%_)
>   (Cool:D: Cool:D $needle, :i(:$ignorecase)!,
> :m(:$ignoremark), *%_
> --> Int:D)
>   (Cool:D: Cool:D $needle, :m(:$ignoremark)!, *%_ --> Int:D)
>   (Cool:D: Cool:D $needle, *%_ --> Int:D)
>   (Cool:D: Cool:D $needle, Cool:D $pos, :i(:$ignorecase)!,
> :m(:$ignoremark), *%_ --> Int:D)
>   (Cool:D: Cool:D $needle, Cool:D $pos, :m(:$ignoremark)!,
> *%_ --> Int:D)
>   (Cool:D: Cool:D $needle, Cool:D $pos, *%_ --> Int:D)
>   (Str:D: Str:D $needle, :i(:$ignorecase)!,
> :m(:$ignoremark), *%_ -->
> Int:D)
>   (Str:D: Str:D $needle, Int:D $pos, :i(:$ignorecase)!,
> :m(:$ignoremark), *%_ --> Int:D)
>   (Str:D: @needles, :i(:$ignorecase)!, :m(:$ignoremark), *%_
> --> Int:D)
>   (Str:D: Str:D $needle, :m(:$ignoremark)!, *%_ --> Int:D)
>   (Str:D: Str:D $needle, Int:D $pos, :m(:$ignoremark)!, *%_
> --> Int:D)
>   (Str:D: @needles, :m(:$ignoremark)!, *%_ --> Int:D)
>   (Str:D: Str:D $needle, *%_ --> Int:D)
>   (Str:D: Str:D $needle, Int:D $pos, *%_ --> Int:D)
>   (Str:D: @needles, *%_ --> Int:D)
> in sub GatherOptions at CobianWrapper.pl6 line 156
> in block  at CobianWrapper.pl6 line 390
On 2020-05-25 23:58, Veesh Goldman wrote:


Actually, in my tests it works fine. You have to show more code.

On Tue, May 26, 2020, 09:49 Veesh Goldman > wrote:


I would guess it's because you interpolated your variables into a
string. Try it without the quotes.
To be more helpful, I'd need a MWE.


I originally did not have the quotes in it.  Removing the
again seems to get past the error.  I must be gettng tired.

Thank you for the assist.  It was afraid of you!

:-)


Rakudo Star 2020.05

2020-05-26 Thread p.spek via perl6-users
Good day Rakoons!

After two release candidates for 2020.05, I'm happy to announce that Rakudo
Star is getting its official 2020.05 release.

With help from hankache on the Windows side of things, we have gotten no
reports of issues that prevent anyone from using this release. The files can be
found at the following URLs:

Rakudo Star tarballs (GNU+Linux, *BSD, Mac):

- https://rakudo.org/dl/star/rakudo-star-2020.05.tar.gz
- https://rakudo.org/dl/star/rakudo-star-2020.05.tar.gz.asc
- https://rakudo.org/dl/star/rakudo-star-2020.05.tar.gz.checksums.txt

Rakudo Star installer (Windows):

- https://rakudo.org/dl/star/rakudo-star-2020.05.1-01-win-x86_64-(JIT).msi
- https://rakudo.org/dl/star/rakudo-star-2020.05.1-01-win-x86_64-(JIT).msi.asc
- 
https://rakudo.org/dl/star/rakudo-star-2020.05.1-01-win-x86_64-(JIT).msi.sha256.txt

If you have comments or issues, please let us know on the mailing list!

-- 
With kind regards,

Patrick Spek


www:  https://www.tyil.nl/
mail: p.s...@tyil.nl
pgp:  1660 F6A2 DFA7 5347 322A  4DC0 7A6A C285 E2D9 8827

social: https://soc.fglt.nl/tyil
git:https://home.tyil.nl/git


signature.asc
Description: PGP signature


I need a second pair of eyes

2020-05-26 Thread ToddAndMargo via perl6-users

HI All,

I am missing something here:


154:   # figure out the label
155:   say %CommandLine;
156:   if "%CommandLine".starts-with( "[" )  &&
157:  "%CommandLine".contains( "]" ) {


BACKUP:\MyDocsBackup\backup1
Cannot resolve caller index(Str:U: Str:D); none of these signatures match:
(List:D: Cool:D $needle, *%_)
(Cool:D: Cool:D $needle, :i(:$ignorecase)!, :m(:$ignoremark), *%_ 
--> Int:D)

(Cool:D: Cool:D $needle, :m(:$ignoremark)!, *%_ --> Int:D)
(Cool:D: Cool:D $needle, *%_ --> Int:D)
(Cool:D: Cool:D $needle, Cool:D $pos, :i(:$ignorecase)!, 
:m(:$ignoremark), *%_ --> Int:D)

(Cool:D: Cool:D $needle, Cool:D $pos, :m(:$ignoremark)!, *%_ --> Int:D)
(Cool:D: Cool:D $needle, Cool:D $pos, *%_ --> Int:D)
(Str:D: Str:D $needle, :i(:$ignorecase)!, :m(:$ignoremark), *%_ --> 
Int:D)
(Str:D: Str:D $needle, Int:D $pos, :i(:$ignorecase)!, 
:m(:$ignoremark), *%_ --> Int:D)

(Str:D: @needles, :i(:$ignorecase)!, :m(:$ignoremark), *%_ --> Int:D)
(Str:D: Str:D $needle, :m(:$ignoremark)!, *%_ --> Int:D)
(Str:D: Str:D $needle, Int:D $pos, :m(:$ignoremark)!, *%_ --> Int:D)
(Str:D: @needles, :m(:$ignoremark)!, *%_ --> Int:D)
(Str:D: Str:D $needle, *%_ --> Int:D)
(Str:D: Str:D $needle, Int:D $pos, *%_ --> Int:D)
(Str:D: @needles, *%_ --> Int:D)
  in sub GatherOptions at CobianWrapper.pl6 line 156
  in block  at CobianWrapper.pl6 line 390


Re: I do not understand method":"

2020-05-26 Thread ToddAndMargo via perl6-users

On 2020-05-25 14:00, Brad Gilbert wrote:

In the following the 「:」 makes it so you don't need parenthesis


You have created a monster!

> my $s="a:c"; say $s.index: ":"
1

:-)