Re: I need a second pair of eyes

2020-05-27 Thread ToddAndMargo via perl6-users

On 2020-05-27 14:26, Will Coleda wrote:

Part of framing the question in the first place is reducing the
problem code to as small a subset as possible that still exhibits the
problem.


AND THEY ALWAYS WORK!     !

No reporting that back to the developers.


Often, in the course of doing this "golfing", you'll uncover the
problem yourself.


Very true.

Usually, I will go back and rewrite the thing as
human readable as possible, and low and behold, it
will start working and I have no clue what was wrong
with the original code.

I have when you have to go back and try and find a
single quote you accidentally copied and pasted from
a one liner test


Re: I need a second pair of eyes

2020-05-27 Thread Will Coleda
Part of framing the question in the first place is reducing the
problem code to as small a subset as possible that still exhibits the
problem.

Often, in the course of doing this "golfing", you'll uncover the
problem yourself.

On Wed, May 27, 2020 at 4:59 PM ToddAndMargo via perl6-users
 wrote:
>
> On 2020-05-27 13:38, Veesh Goldman wrote:
> > well, like I said before, if you just show ALL of your code, then we'd
> > be able to know what happened.
>
> I fixed the mistake I made, which also fixed the
> wrong output from "say", so all is working now
> and I doubt the issue would reproduce.
>
> The code itself is 420 lines long, plus modules.
> Would you like me to eMail you the code and
> all the modules?  I am no sure what you can do
> with it.


Re: I need a second pair of eyes

2020-05-27 Thread ToddAndMargo via perl6-users

On 2020-05-27 13:38, Veesh Goldman wrote:
well, like I said before, if you just show ALL of your code, then we'd 
be able to know what happened.


I fixed the mistake I made, which also fixed the
wrong output from "say", so all is working now
and I doubt the issue would reproduce.

The code itself is 420 lines long, plus modules.
Would you like me to eMail you the code and
all the modules?  I am no sure what you can do
with it.


Re: I need a second pair of eyes

2020-05-27 Thread ToddAndMargo via perl6-users

On 2020-05-27 07:27, Brad Gilbert wrote:

The point was that 「say」 will print undefined values without complaining.

Really debug statements should be more like:

$*STDERR.put: 「%CommandLine = 」, %CommandLine;

Or more succinctly:

dd %CommandLine;




Which does bring to the forefront, why a duplicate
copy and paste of the same say line, one on
top of the other, first delivered a value from
another variable and the second one gave the correct
value.

I have converted to this say free sort of stuff;

   if  %Options< Debug >  {
  print "   ParentDir = <$ParentDir>\n";
  print "   NumBackups <$NumBackups>  Rotates %Options< Rotates >\n";
  print "   Sorted List   = [" ~ @Sorted_List ~ "]\n";
  print "   Ordered List  = [" ~ @Ordered_List ~ "]\n";
  print "   Rotated List  = [" ~ @Rotated_List ~ "]\n";
  print "   Reverse List  = [" ~ @Reverse_Pruned_List ~ "]\n";
  print "   Reverse_Pruned List = [" ~ @Reverse_Pruned_List ~ "]\n";
  print "   Number of backup directories is $NumBackups\n\n";
   }


I like dd if I am interested in the structure of a variable
but avoid it if only the value is of interest.

And I could never in a million years be able to
duplicate this issue for the developers


Re: I need a second pair of eyes

2020-05-27 Thread ToddAndMargo via perl6-users

On 2020-05-26 23:39, Peter Pentchev wrote:

On Tue, May 26, 2020 at 07:16:54PM -0700, 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

[snip]



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!


This is... strange. Are you really, really sure that the "say" and
the "print" were really used on the same variable with the same value?
And the value is supposed to be a (possibly undefined) string?
And when the value is an undefined string (and nothing changes it after
"say" is called on it), "say" outputs something that looks like
a valid path?

This would be really, really strange. I'd say it would qualify as a bug,
unless there is something else happening there.

Are you really, really, really sure that there is nothing between
the call to "say" and the place where you use the variable that could
change the value? Are you also really, really, really sure that you have
not mistyped one of the names? If so, is there a way you could create
a minimal example, a short program that, when run on your system, always
behaves this way, and post it (attach the source file, don't retype it)
in full, so that people can try to run it on their systems and see if
"say" really does something strange?

G'luck,
Peter



Hi Peter,

What you saw is what I had.  Originally, I
thought I just need a second pair of eyes
and that I thought I saw what I saw, which
does happen to me more times than I would like
to admit.

What tipped me off was when I put a second
duplicate (copy and paste) say line right under
the first and the second one returned nothing.
This made me go back and look at how I populated
the variable in question and I found I had made
several mistakes and, indeed, the variable was
blank.

The value say gave, where it was suppose to give
a blank, was actually a value collected from the
run line that was used to populate the variable
in question.

The real bugger is that when things like this
happen, my first suspicion is that it is me doing
something wrong and 99% of the time that is the
case, so I had no idea this would be a Raku issue.
I wasted a lot of time chasing the wrong rabbit
down the wrong hole.

Oh ya, and good luck reproducing this for the
developers.

-T


Re: I need a second pair of eyes

2020-05-27 Thread Brad Gilbert
The point was that 「say」 will print undefined values without complaining.

Really debug statements should be more like:

$*STDERR.put: 「%CommandLine = 」, %CommandLine;

Or more succinctly:

dd %CommandLine;

On Wed, May 27, 2020 at 1:39 AM Peter Pentchev  wrote:

> On Tue, May 26, 2020 at 07:16:54PM -0700, 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
> [snip]
> >
> >
> > 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!
>
> This is... strange. Are you really, really sure that the "say" and
> the "print" were really used on the same variable with the same value?
> And the value is supposed to be a (possibly undefined) string?
> And when the value is an undefined string (and nothing changes it after
> "say" is called on it), "say" outputs something that looks like
> a valid path?
>
> This would be really, really strange. I'd say it would qualify as a bug,
> unless there is something else happening there.
>
> Are you really, really, really sure that there is nothing between
> the call to "say" and the place where you use the variable that could
> change the value? Are you also really, really, really sure that you have
> not mistyped one of the names? If so, is there a way you could create
> a minimal example, a short program that, when run on your system, always
> behaves this way, and post it (attach the source file, don't retype it)
> in full, so that people can try to run it on their systems and see if
> "say" really does something strange?
>
> G'luck,
> Peter
>
> --
> Peter Pentchev  r...@ringlet.net r...@debian.org p...@storpool.com
> PGP key:http://people.FreeBSD.org/~roam/roam.key.asc
> Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13
>


Re: I need a second pair of eyes

2020-05-27 Thread Peter Pentchev
On Tue, May 26, 2020 at 07:16:54PM -0700, 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
[snip]
> 
> 
> 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!

This is... strange. Are you really, really sure that the "say" and
the "print" were really used on the same variable with the same value?
And the value is supposed to be a (possibly undefined) string?
And when the value is an undefined string (and nothing changes it after
"say" is called on it), "say" outputs something that looks like
a valid path?

This would be really, really strange. I'd say it would qualify as a bug,
unless there is something else happening there.

Are you really, really, really sure that there is nothing between
the call to "say" and the place where you use the variable that could
change the value? Are you also really, really, really sure that you have
not mistyped one of the names? If so, is there a way you could create
a minimal example, a short program that, when run on your system, always
behaves this way, and post it (attach the source file, don't retype it)
in full, so that people can try to run it on their systems and see if
"say" really does something strange?

G'luck,
Peter

-- 
Peter Pentchev  r...@ringlet.net r...@debian.org p...@storpool.com
PGP key:http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13


signature.asc
Description: PGP signature


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: 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-users@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-users@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 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-users@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


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-users@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!

:-)