I need help with IO.e

Hi All,.

Windows 7, sp1, x64

 >raku -v
This is Rakudo version 2020.01 built on MoarVM version
2020.01.1 implementing Perl 6.d.


I am trying to get perl to tell me if a drive letter exists

This is from Git's df command:

 >df -kPT H:\
Filesystem     Type 1024-blocks  Used Available Capacity Mounted on
H:             ntfs       38908  9964     28944      26% /h

So, H:\ is there

 >raku "say H:\.IO.e"
Could not open say H:\.IO.e. Failed to stat file: no such file or directory

And in case I need \\

 >raku "say H:\\.IO.e"
Could not open say H:\\.IO.e. Failed to stat file: no such file or directory

And in case I need a forward slashL:
 >raku "say H:/.IO.e"
Could not open say H:/.IO.e. Failed to stat file: no such file or directory

What am I doing wrong, this time?

-T

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0
perl6
5/16/2020 5:30:33 AM
perl.perl6.users 1497 articles. 0 followers. Follow

50 Replies
74 Views

Similar Articles

[PageSpeed] 15

On 2020-05-15 22:30, ToddAndMargo via perl6-users wrote:
> Hi All,.
>=20
> Windows 7, sp1, x64
>=20
>  >raku -v
> This is Rakudo version 2020.01 built on MoarVM version
> 2020.01.1 implementing Perl 6.d.
>=20
>=20
> I am trying to get perl to tell me if a drive letter exists
>=20
> This is from Git's df command:
>=20
>  >df -kPT H:\
> Filesystem=C2=A0=C2=A0=C2=A0=C2=A0 Type 1024-blocks=C2=A0 Used Availabl=
e Capacity Mounted on
> H:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 ntfs=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 38908=C2=A0 9964=C2=A0=C2=A0=
=C2=A0=C2=A0 28944=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 26% /h
>=20
> So, H:\ is there
>=20
>  >raku "say H:\.IO.e"
> Could not open say H:\.IO.e. Failed to stat file: no such file or direc=
tory
>=20
> And in case I need \\
>=20
>  >raku "say H:\\.IO.e"
> Could not open say H:\\.IO.e. Failed to stat file: no such file or=20
> directory
>=20
> And in case I need a forward slashL:
>  >raku "say H:/.IO.e"
> Could not open say H:/.IO.e. Failed to stat file: no such file or direc=
tory
>=20
> What am I doing wrong, this time?
>=20
> -T
>=20


As far as I can tell IO.e and IO.d is completely trashed
in Windows:

K:\Windows\NtUtil>dir H:
  Volume in drive H is BACKUP
  Volume Serial Number is 00D0-CAD4

  Directory of H:\

05/15/2020  22:21                 0 IAmBackup
05/15/2020  22:43    <DIR>          MyDocsBackup
                1 File(s)              0 bytes
                1 Dir(s)      29,638,656 bytes free



K:\Windows\NtUtil>raku "say 'h://IAmBackup'.IO.e"
Could not open say 'h://IAmBackup'.IO.e. Failed to stat file: no such=20
file or di
rectory

K:\Windows\NtUtil>raku "say 'h:/IAmBackup'.IO.e"
Could not open say 'h:/IAmBackup'.IO.e. Failed to stat file: no such=20
file or directory

K:\Windows\NtUtil>raku "say 'h:\IAmBackup'.IO.e"
Could not open say 'h:\IAmBackup'.IO.e. Failed to stat file: no such=20
file or directory

K:\Windows\NtUtil>raku "say 'h:\\IAmBackup'.IO.e"
Could not open say 'h:\\IAmBackup'.IO.e. Failed to stat file: no such=20
file or directory


And that goes for IO.d too:

K:\Windows\NtUtil>raku "say 'h:\\MyDocsBackup'.IO.d"
Could not open say 'h:\\MyDocsBackup'.IO.d. Failed to stat file: no such =

file or
  directory

K:\Windows\NtUtil>raku "say 'h:\MyDocsBackup'.IO.d"
Could not open say 'h:\MyDocsBackup'.IO.d. Failed to stat file: no such=20
file or directory

K:\Windows\NtUtil>raku "say 'h:/MyDocsBackup'.IO.d"
Could not open say 'h:/MyDocsBackup'.IO.d. Failed to stat file: no such=20
file or directory

K:\Windows\NtUtil>raku "say 'h://MyDocsBackup'.IO.d"
Could not open say 'h://MyDocsBackup'.IO.d. Failed to stat file: no such =

file or  directory

This gets a TRIPLE:  :'(  :'(  :'(



And it only works slightly better under Fedora:

$ p6 'say "GetOptLongTest.pl6".IO.e'
True

$ p6 'say "GetOptLongTest.pl7".IO.e'
False

$ p6 'say "p6lib".IO.d'
True

$ p6 'say "p7lib".IO.d'
Failed to find '/home/linuxutil/p7lib' while trying to do '.d'
   in block <unit> at -e line 1

Notice that it crashed instead of returning a False.

This gets a single :'(

<editorial comment> AAAAAAHHHHHH!!!! </editorial comment>
0
perl6
5/16/2020 10:16:36 AM
--000000000000d8b8c705a5c23d65
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi,

it should be:

$ raku *-e* "your one-liner script here"

Best regards,
Laurent.

Le sam. 16 mai 2020 =C3=A0 12:16, ToddAndMargo via perl6-users <
perl6-users@perl.org> a =C3=A9crit :

> On 2020-05-15 22:30, ToddAndMargo via perl6-users wrote:
> > Hi All,.
> >
> > Windows 7, sp1, x64
> >
> >  >raku -v
> > This is Rakudo version 2020.01 built on MoarVM version
> > 2020.01.1 implementing Perl 6.d.
> >
> >
> > I am trying to get perl to tell me if a drive letter exists
> >
> > This is from Git's df command:
> >
> >  >df -kPT H:\
> > Filesystem     Type 1024-blocks  Used Available Capacity Mounted on
> > H:             ntfs       38908  9964     28944      26% /h
> >
> > So, H:\ is there
> >
> >  >raku "say H:\.IO.e"
> > Could not open say H:\.IO.e. Failed to stat file: no such file or
> directory
> >
> > And in case I need \\
> >
> >  >raku "say H:\\.IO.e"
> > Could not open say H:\\.IO.e. Failed to stat file: no such file or
> > directory
> >
> > And in case I need a forward slashL:
> >  >raku "say H:/.IO.e"
> > Could not open say H:/.IO.e. Failed to stat file: no such file or
> directory
> >
> > What am I doing wrong, this time?
> >
> > -T
> >
>
>
> As far as I can tell IO.e and IO.d is completely trashed
> in Windows:
>
> K:\Windows\NtUtil>dir H:
>   Volume in drive H is BACKUP
>   Volume Serial Number is 00D0-CAD4
>
>   Directory of H:\
>
> 05/15/2020  22:21                 0 IAmBackup
> 05/15/2020  22:43    <DIR>          MyDocsBackup
>                 1 File(s)              0 bytes
>                 1 Dir(s)      29,638,656 bytes free
>
>
>
> K:\Windows\NtUtil>raku "say 'h://IAmBackup'.IO.e"
> Could not open say 'h://IAmBackup'.IO.e. Failed to stat file: no such
> file or di
> rectory
>
> K:\Windows\NtUtil>raku "say 'h:/IAmBackup'.IO.e"
> Could not open say 'h:/IAmBackup'.IO.e. Failed to stat file: no such
> file or directory
>
> K:\Windows\NtUtil>raku "say 'h:\IAmBackup'.IO.e"
> Could not open say 'h:\IAmBackup'.IO.e. Failed to stat file: no such
> file or directory
>
> K:\Windows\NtUtil>raku "say 'h:\\IAmBackup'.IO.e"
> Could not open say 'h:\\IAmBackup'.IO.e. Failed to stat file: no such
> file or directory
>
>
> And that goes for IO.d too:
>
> K:\Windows\NtUtil>raku "say 'h:\\MyDocsBackup'.IO.d"
> Could not open say 'h:\\MyDocsBackup'.IO.d. Failed to stat file: no such
> file or
>   directory
>
> K:\Windows\NtUtil>raku "say 'h:\MyDocsBackup'.IO.d"
> Could not open say 'h:\MyDocsBackup'.IO.d. Failed to stat file: no such
> file or directory
>
> K:\Windows\NtUtil>raku "say 'h:/MyDocsBackup'.IO.d"
> Could not open say 'h:/MyDocsBackup'.IO.d. Failed to stat file: no such
> file or directory
>
> K:\Windows\NtUtil>raku "say 'h://MyDocsBackup'.IO.d"
> Could not open say 'h://MyDocsBackup'.IO.d. Failed to stat file: no such
> file or  directory
>
> This gets a TRIPLE:  :'(  :'(  :'(
>
>
>
> And it only works slightly better under Fedora:
>
> $ p6 'say "GetOptLongTest.pl6".IO.e'
> True
>
> $ p6 'say "GetOptLongTest.pl7".IO.e'
> False
>
> $ p6 'say "p6lib".IO.d'
> True
>
> $ p6 'say "p7lib".IO.d'
> Failed to find '/home/linuxutil/p7lib' while trying to do '.d'
>    in block <unit> at -e line 1
>
> Notice that it crashed instead of returning a False.
>
> This gets a single :'(
>
> <editorial comment> AAAAAAHHHHHH!!!! </editorial comment>
>

--000000000000d8b8c705a5c23d65
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi,</div><div><br></div><div>it should be:</div><div>=
<br></div><div>$ raku <span style=3D"color:rgb(255,0,0)"><b>-e</b></span> &=
quot;your one-liner script here&quot;</div><div><br></div><div>Best regards=
,</div><div>Laurent.<br></div></div><br><div class=3D"gmail_quote"><div dir=
=3D"ltr" class=3D"gmail_attr">Le=C2=A0sam. 16 mai 2020 =C3=A0=C2=A012:16, T=
oddAndMargo via perl6-users &lt;<a href=3D"mailto:perl6-users@perl.org">per=
l6-users@perl.org</a>&gt; a =C3=A9crit=C2=A0:<br></div><blockquote class=3D=
"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(2=
04,204,204);padding-left:1ex">On 2020-05-15 22:30, ToddAndMargo via perl6-u=
sers wrote:<br>
&gt; Hi All,.<br>
&gt; <br>
&gt; Windows 7, sp1, x64<br>
&gt; <br>
&gt;=C2=A0 &gt;raku -v<br>
&gt; This is Rakudo version 2020.01 built on MoarVM version<br>
&gt; 2020.01.1 implementing Perl 6.d.<br>
&gt; <br>
&gt; <br>
&gt; I am trying to get perl to tell me if a drive letter exists<br>
&gt; <br>
&gt; This is from Git&#39;s df command:<br>
&gt; <br>
&gt;=C2=A0 &gt;df -kPT H:\<br>
&gt; Filesystem=C2=A0=C2=A0=C2=A0=C2=A0 Type 1024-blocks=C2=A0 Used Availab=
le Capacity Mounted on<br>
&gt; H:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 ntfs=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 38908=C2=A0 9964=C2=A0=C2=
=A0=C2=A0=C2=A0 28944=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 26% /h<br>
&gt; <br>
&gt; So, H:\ is there<br>
&gt; <br>
&gt;=C2=A0 &gt;raku &quot;say H:\.IO.e&quot;<br>
&gt; Could not open say H:\.IO.e. Failed to stat file: no such file or dire=
ctory<br>
&gt; <br>
&gt; And in case I need \\<br>
&gt; <br>
&gt;=C2=A0 &gt;raku &quot;say H:\\.IO.e&quot;<br>
&gt; Could not open say H:\\.IO.e. Failed to stat file: no such file or <br=
>
&gt; directory<br>
&gt; <br>
&gt; And in case I need a forward slashL:<br>
&gt;=C2=A0 &gt;raku &quot;say H:/.IO.e&quot;<br>
&gt; Could not open say H:/.IO.e. Failed to stat file: no such file or dire=
ctory<br>
&gt; <br>
&gt; What am I doing wrong, this time?<br>
&gt; <br>
&gt; -T<br>
&gt; <br>
<br>
<br>
As far as I can tell IO.e and IO.d is completely trashed<br>
in Windows:<br>
<br>
K:\Windows\NtUtil&gt;dir H:<br>
=C2=A0 Volume in drive H is BACKUP<br>
=C2=A0 Volume Serial Number is 00D0-CAD4<br>
<br>
=C2=A0 Directory of H:\<br>
<br>
05/15/2020=C2=A0 22:21=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A00 IAmBackup<br>
05/15/2020=C2=A0 22:43=C2=A0 =C2=A0 &lt;DIR&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 MyDocsBackup<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 1 File(s)=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0 bytes<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 1 Dir(s)=C2=A0 =C2=
=A0 =C2=A0 29,638,656 bytes free<br>
<br>
<br>
<br>
K:\Windows\NtUtil&gt;raku &quot;say &#39;h://IAmBackup&#39;.IO.e&quot;<br>
Could not open say &#39;h://IAmBackup&#39;.IO.e. Failed to stat file: no su=
ch <br>
file or di<br>
rectory<br>
<br>
K:\Windows\NtUtil&gt;raku &quot;say &#39;h:/IAmBackup&#39;.IO.e&quot;<br>
Could not open say &#39;h:/IAmBackup&#39;.IO.e. Failed to stat file: no suc=
h <br>
file or directory<br>
<br>
K:\Windows\NtUtil&gt;raku &quot;say &#39;h:\IAmBackup&#39;.IO.e&quot;<br>
Could not open say &#39;h:\IAmBackup&#39;.IO.e. Failed to stat file: no suc=
h <br>
file or directory<br>
<br>
K:\Windows\NtUtil&gt;raku &quot;say &#39;h:\\IAmBackup&#39;.IO.e&quot;<br>
Could not open say &#39;h:\\IAmBackup&#39;.IO.e. Failed to stat file: no su=
ch <br>
file or directory<br>
<br>
<br>
And that goes for IO.d too:<br>
<br>
K:\Windows\NtUtil&gt;raku &quot;say &#39;h:\\MyDocsBackup&#39;.IO.d&quot;<b=
r>
Could not open say &#39;h:\\MyDocsBackup&#39;.IO.d. Failed to stat file: no=
 such <br>
file or<br>
=C2=A0 directory<br>
<br>
K:\Windows\NtUtil&gt;raku &quot;say &#39;h:\MyDocsBackup&#39;.IO.d&quot;<br=
>
Could not open say &#39;h:\MyDocsBackup&#39;.IO.d. Failed to stat file: no =
such <br>
file or directory<br>
<br>
K:\Windows\NtUtil&gt;raku &quot;say &#39;h:/MyDocsBackup&#39;.IO.d&quot;<br=
>
Could not open say &#39;h:/MyDocsBackup&#39;.IO.d. Failed to stat file: no =
such <br>
file or directory<br>
<br>
K:\Windows\NtUtil&gt;raku &quot;say &#39;h://MyDocsBackup&#39;.IO.d&quot;<b=
r>
Could not open say &#39;h://MyDocsBackup&#39;.IO.d. Failed to stat file: no=
 such <br>
file or=C2=A0 directory<br>
<br>
This gets a TRIPLE:=C2=A0 :&#39;(=C2=A0 :&#39;(=C2=A0 :&#39;(<br>
<br>
<br>
<br>
And it only works slightly better under Fedora:<br>
<br>
$ p6 &#39;say &quot;GetOptLongTest.pl6&quot;.IO.e&#39;<br>
True<br>
<br>
$ p6 &#39;say &quot;GetOptLongTest.pl7&quot;.IO.e&#39;<br>
False<br>
<br>
$ p6 &#39;say &quot;p6lib&quot;.IO.d&#39;<br>
True<br>
<br>
$ p6 &#39;say &quot;p7lib&quot;.IO.d&#39;<br>
Failed to find &#39;/home/linuxutil/p7lib&#39; while trying to do &#39;.d&#=
39;<br>
=C2=A0 =C2=A0in block &lt;unit&gt; at -e line 1<br>
<br>
Notice that it crashed instead of returning a False.<br>
<br>
This gets a single :&#39;(<br>
<br>
&lt;editorial comment&gt; AAAAAAHHHHHH!!!! &lt;/editorial comment&gt;<br>
</blockquote></div>

--000000000000d8b8c705a5c23d65--
0
perl6
5/16/2020 11:29:12 AM
--000000000000dc030a05a5c328bf
Content-Type: text/plain; charset="UTF-8"

There are three possibilities for the.d test -- the file exists and is a
directory, the files exists and is not a directory, and the file does not
exist. The test needs to distinguish between these three cases.

The documentation for .d states:

Returns True if the invocant is a path that exists and is a directory. The
method will fail <https://docs.raku.org/routine/fail> with
X::IO::DoesNotExist if the path points to a non-existent filesystem entity.

(and by implication False if the file exists and is not a directory). In
other words it is behaving exactly as specified.

If you want to allow for the possibility that the file does not exist at
all, then you either need to catch the exception, or check for file
existence first.

Something like
'p7lib'.IO ~~ :e & :d
might work, although I haven't tested it.

Kevin.


On Sat, 16 May 2020 at 20:16, ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:

> On 2020-05-15 22:30, ToddAndMargo via perl6-users wrote:
> > Hi All,.
> >
> > Windows 7, sp1, x64
> >
> >  >raku -v
> > This is Rakudo version 2020.01 built on MoarVM version
> > 2020.01.1 implementing Perl 6.d.
> >
> >
> > I am trying to get perl to tell me if a drive letter exists
> >
> > This is from Git's df command:
> >
> >  >df -kPT H:\
> > Filesystem     Type 1024-blocks  Used Available Capacity Mounted on
> > H:             ntfs       38908  9964     28944      26% /h
> >
> > So, H:\ is there
> >
> >  >raku "say H:\.IO.e"
> > Could not open say H:\.IO.e. Failed to stat file: no such file or
> directory
> >
> > And in case I need \\
> >
> >  >raku "say H:\\.IO.e"
> > Could not open say H:\\.IO.e. Failed to stat file: no such file or
> > directory
> >
> > And in case I need a forward slashL:
> >  >raku "say H:/.IO.e"
> > Could not open say H:/.IO.e. Failed to stat file: no such file or
> directory
> >
> > What am I doing wrong, this time?
> >
> > -T
> >
>
>
> As far as I can tell IO.e and IO.d is completely trashed
> in Windows:
>
> K:\Windows\NtUtil>dir H:
>   Volume in drive H is BACKUP
>   Volume Serial Number is 00D0-CAD4
>
>   Directory of H:\
>
> 05/15/2020  22:21                 0 IAmBackup
> 05/15/2020  22:43    <DIR>          MyDocsBackup
>                 1 File(s)              0 bytes
>                 1 Dir(s)      29,638,656 bytes free
>
>
>
> K:\Windows\NtUtil>raku "say 'h://IAmBackup'.IO.e"
> Could not open say 'h://IAmBackup'.IO.e. Failed to stat file: no such
> file or di
> rectory
>
> K:\Windows\NtUtil>raku "say 'h:/IAmBackup'.IO.e"
> Could not open say 'h:/IAmBackup'.IO.e. Failed to stat file: no such
> file or directory
>
> K:\Windows\NtUtil>raku "say 'h:\IAmBackup'.IO.e"
> Could not open say 'h:\IAmBackup'.IO.e. Failed to stat file: no such
> file or directory
>
> K:\Windows\NtUtil>raku "say 'h:\\IAmBackup'.IO.e"
> Could not open say 'h:\\IAmBackup'.IO.e. Failed to stat file: no such
> file or directory
>
>
> And that goes for IO.d too:
>
> K:\Windows\NtUtil>raku "say 'h:\\MyDocsBackup'.IO.d"
> Could not open say 'h:\\MyDocsBackup'.IO.d. Failed to stat file: no such
> file or
>   directory
>
> K:\Windows\NtUtil>raku "say 'h:\MyDocsBackup'.IO.d"
> Could not open say 'h:\MyDocsBackup'.IO.d. Failed to stat file: no such
> file or directory
>
> K:\Windows\NtUtil>raku "say 'h:/MyDocsBackup'.IO.d"
> Could not open say 'h:/MyDocsBackup'.IO.d. Failed to stat file: no such
> file or directory
>
> K:\Windows\NtUtil>raku "say 'h://MyDocsBackup'.IO.d"
> Could not open say 'h://MyDocsBackup'.IO.d. Failed to stat file: no such
> file or  directory
>
> This gets a TRIPLE:  :'(  :'(  :'(
>
>
>
> And it only works slightly better under Fedora:
>
> $ p6 'say "GetOptLongTest.pl6".IO.e'
> True
>
> $ p6 'say "GetOptLongTest.pl7".IO.e'
> False
>
> $ p6 'say "p6lib".IO.d'
> True
>
> $ p6 'say "p7lib".IO.d'
> Failed to find '/home/linuxutil/p7lib' while trying to do '.d'
>    in block <unit> at -e line 1
>
> Notice that it crashed instead of returning a False.
>
> This gets a single :'(
>
> <editorial comment> AAAAAAHHHHHH!!!! </editorial comment>
>

--000000000000dc030a05a5c328bf
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>There are three possibilities for the.d test -- the f=
ile exists and is a directory, the files exists and is not a directory, and=
 the file does not exist. The test needs to distinguish between these three=
 cases.</div><div><br></div><div>The documentation for .d states:<br></div>=
<div><br></div><div><span style=3D"color:rgb(0,0,0);font-family:sans-serif"=
>Returns=C2=A0</span><code style=3D"color:rgb(102,102,102)">True</code><spa=
n style=3D"color:rgb(0,0,0);font-family:sans-serif">=C2=A0if the invocant i=
s a path that exists and is a directory. The method will=C2=A0</span><a hre=
f=3D"https://docs.raku.org/routine/fail" style=3D"font-family:sans-serif"><=
code style=3D"color:rgb(0,0,238)">fail</code></a><span style=3D"color:rgb(0=
,0,0);font-family:sans-serif">=C2=A0with=C2=A0</span><code style=3D"color:r=
gb(102,102,102)">X::IO::DoesNotExist</code><span style=3D"color:rgb(0,0,0);=
font-family:sans-serif">=C2=A0if the path points to a non-existent filesyst=
em entity.</span><br></div><div><span style=3D"color:rgb(0,0,0);font-family=
:sans-serif"><br></span></div><div><span style=3D"color:rgb(0,0,0);font-fam=
ily:sans-serif">(and by implication False if the file exists and is not a d=
irectory). In other words it is behaving exactly as specified.</span></div>=
<div><span style=3D"color:rgb(0,0,0);font-family:sans-serif"><br></span></d=
iv><div><span style=3D"color:rgb(0,0,0);font-family:sans-serif">If you want=
 to allow for the possibility that the file does not exist at all, then you=
 either need to catch the exception, or check for file existence first.</sp=
an></div><div><span style=3D"color:rgb(0,0,0);font-family:sans-serif"><br><=
/span></div><div><span style=3D"color:rgb(0,0,0);font-family:sans-serif">So=
mething like</span></div><div><span style=3D"color:rgb(0,0,0);font-family:s=
ans-serif">&#39;p7lib&#39;.IO ~~ :e &amp; :d</span></div><div><span style=
=3D"color:rgb(0,0,0);font-family:sans-serif">might work, although I haven&#=
39;t tested it.</span></div><div><span style=3D"color:rgb(0,0,0);font-famil=
y:sans-serif"><br></span></div><div><span style=3D"color:rgb(0,0,0);font-fa=
mily:sans-serif">Kevin.</span></div><div><br></div></div><br><div class=3D"=
gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Sat, 16 May 2020 at 2=
0:16, ToddAndMargo via perl6-users &lt;<a href=3D"mailto:perl6-users@perl.o=
rg" target=3D"_blank">perl6-users@perl.org</a>&gt; wrote:<br></div><blockqu=
ote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px=
 solid rgb(204,204,204);padding-left:1ex">On 2020-05-15 22:30, ToddAndMargo=
 via perl6-users wrote:<br>
&gt; Hi All,.<br>
&gt; <br>
&gt; Windows 7, sp1, x64<br>
&gt; <br>
&gt;=C2=A0 &gt;raku -v<br>
&gt; This is Rakudo version 2020.01 built on MoarVM version<br>
&gt; 2020.01.1 implementing Perl 6.d.<br>
&gt; <br>
&gt; <br>
&gt; I am trying to get perl to tell me if a drive letter exists<br>
&gt; <br>
&gt; This is from Git&#39;s df command:<br>
&gt; <br>
&gt;=C2=A0 &gt;df -kPT H:\<br>
&gt; Filesystem=C2=A0=C2=A0=C2=A0=C2=A0 Type 1024-blocks=C2=A0 Used Availab=
le Capacity Mounted on<br>
&gt; H:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 ntfs=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 38908=C2=A0 9964=C2=A0=C2=
=A0=C2=A0=C2=A0 28944=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 26% /h<br>
&gt; <br>
&gt; So, H:\ is there<br>
&gt; <br>
&gt;=C2=A0 &gt;raku &quot;say H:\.IO.e&quot;<br>
&gt; Could not open say H:\.IO.e. Failed to stat file: no such file or dire=
ctory<br>
&gt; <br>
&gt; And in case I need \\<br>
&gt; <br>
&gt;=C2=A0 &gt;raku &quot;say H:\\.IO.e&quot;<br>
&gt; Could not open say H:\\.IO.e. Failed to stat file: no such file or <br=
>
&gt; directory<br>
&gt; <br>
&gt; And in case I need a forward slashL:<br>
&gt;=C2=A0 &gt;raku &quot;say H:/.IO.e&quot;<br>
&gt; Could not open say H:/.IO.e. Failed to stat file: no such file or dire=
ctory<br>
&gt; <br>
&gt; What am I doing wrong, this time?<br>
&gt; <br>
&gt; -T<br>
&gt; <br>
<br>
<br>
As far as I can tell IO.e and IO.d is completely trashed<br>
in Windows:<br>
<br>
K:\Windows\NtUtil&gt;dir H:<br>
=C2=A0 Volume in drive H is BACKUP<br>
=C2=A0 Volume Serial Number is 00D0-CAD4<br>
<br>
=C2=A0 Directory of H:\<br>
<br>
05/15/2020=C2=A0 22:21=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A00 IAmBackup<br>
05/15/2020=C2=A0 22:43=C2=A0 =C2=A0 &lt;DIR&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 MyDocsBackup<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 1 File(s)=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0 bytes<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 1 Dir(s)=C2=A0 =C2=
=A0 =C2=A0 29,638,656 bytes free<br>
<br>
<br>
<br>
K:\Windows\NtUtil&gt;raku &quot;say &#39;h://IAmBackup&#39;.IO.e&quot;<br>
Could not open say &#39;h://IAmBackup&#39;.IO.e. Failed to stat file: no su=
ch <br>
file or di<br>
rectory<br>
<br>
K:\Windows\NtUtil&gt;raku &quot;say &#39;h:/IAmBackup&#39;.IO.e&quot;<br>
Could not open say &#39;h:/IAmBackup&#39;.IO.e. Failed to stat file: no suc=
h <br>
file or directory<br>
<br>
K:\Windows\NtUtil&gt;raku &quot;say &#39;h:\IAmBackup&#39;.IO.e&quot;<br>
Could not open say &#39;h:\IAmBackup&#39;.IO.e. Failed to stat file: no suc=
h <br>
file or directory<br>
<br>
K:\Windows\NtUtil&gt;raku &quot;say &#39;h:\\IAmBackup&#39;.IO.e&quot;<br>
Could not open say &#39;h:\\IAmBackup&#39;.IO.e. Failed to stat file: no su=
ch <br>
file or directory<br>
<br>
<br>
And that goes for IO.d too:<br>
<br>
K:\Windows\NtUtil&gt;raku &quot;say &#39;h:\\MyDocsBackup&#39;.IO.d&quot;<b=
r>
Could not open say &#39;h:\\MyDocsBackup&#39;.IO.d. Failed to stat file: no=
 such <br>
file or<br>
=C2=A0 directory<br>
<br>
K:\Windows\NtUtil&gt;raku &quot;say &#39;h:\MyDocsBackup&#39;.IO.d&quot;<br=
>
Could not open say &#39;h:\MyDocsBackup&#39;.IO.d. Failed to stat file: no =
such <br>
file or directory<br>
<br>
K:\Windows\NtUtil&gt;raku &quot;say &#39;h:/MyDocsBackup&#39;.IO.d&quot;<br=
>
Could not open say &#39;h:/MyDocsBackup&#39;.IO.d. Failed to stat file: no =
such <br>
file or directory<br>
<br>
K:\Windows\NtUtil&gt;raku &quot;say &#39;h://MyDocsBackup&#39;.IO.d&quot;<b=
r>
Could not open say &#39;h://MyDocsBackup&#39;.IO.d. Failed to stat file: no=
 such <br>
file or=C2=A0 directory<br>
<br>
This gets a TRIPLE:=C2=A0 :&#39;(=C2=A0 :&#39;(=C2=A0 :&#39;(<br>
<br>
<br>
<br>
And it only works slightly better under Fedora:<br>
<br>
$ p6 &#39;say &quot;GetOptLongTest.pl6&quot;.IO.e&#39;<br>
True<br>
<br>
$ p6 &#39;say &quot;GetOptLongTest.pl7&quot;.IO.e&#39;<br>
False<br>
<br>
$ p6 &#39;say &quot;p6lib&quot;.IO.d&#39;<br>
True<br>
<br>
$ p6 &#39;say &quot;p7lib&quot;.IO.d&#39;<br>
Failed to find &#39;/home/linuxutil/p7lib&#39; while trying to do &#39;.d&#=
39;<br>
=C2=A0 =C2=A0in block &lt;unit&gt; at -e line 1<br>
<br>
Notice that it crashed instead of returning a False.<br>
<br>
This gets a single :&#39;(<br>
<br>
&lt;editorial comment&gt; AAAAAAHHHHHH!!!! &lt;/editorial comment&gt;<br>
</blockquote></div>

--000000000000dc030a05a5c328bf--
0
kevin
5/16/2020 12:34:54 PM
--8bLSEqNM5P+Jqlqx
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, May 16, 2020 at 01:29:12PM +0200, Laurent Rosenfeld via perl6-users=
 wrote:
> Hi,
>=20
> it should be:
>=20
> $ raku *-e* "your one-liner script here"

And also you might want to put some quotes around the paths to let Raku
know that those are strings and not some identifiers or something.

G'luck,
Peter

> Le sam. 16 mai 2020 =C3=A0 12:16, ToddAndMargo via perl6-users <
> perl6-users@perl.org> a =C3=A9crit :
>=20
> > On 2020-05-15 22:30, ToddAndMargo via perl6-users wrote:
> > > Hi All,.
> > >
> > > Windows 7, sp1, x64
> > >
> > >  >raku -v
> > > This is Rakudo version 2020.01 built on MoarVM version
> > > 2020.01.1 implementing Perl 6.d.
> > >
> > >
> > > I am trying to get perl to tell me if a drive letter exists
> > >
> > > This is from Git's df command:
> > >
> > >  >df -kPT H:\
> > > Filesystem     Type 1024-blocks  Used Available Capacity Mounted on
> > > H:             ntfs       38908  9964     28944      26% /h
> > >
> > > So, H:\ is there
> > >
> > >  >raku "say H:\.IO.e"
> > > Could not open say H:\.IO.e. Failed to stat file: no such file or
> > directory
> > >
> > > And in case I need \\
> > >
> > >  >raku "say H:\\.IO.e"
> > > Could not open say H:\\.IO.e. Failed to stat file: no such file or
> > > directory
> > >
> > > And in case I need a forward slashL:
> > >  >raku "say H:/.IO.e"
> > > Could not open say H:/.IO.e. Failed to stat file: no such file or
> > directory
> > >
> > > What am I doing wrong, this time?
> > >
> > > -T
> > >
> >
> >
> > As far as I can tell IO.e and IO.d is completely trashed
> > in Windows:
> >
> > K:\Windows\NtUtil>dir H:
> >   Volume in drive H is BACKUP
> >   Volume Serial Number is 00D0-CAD4
> >
> >   Directory of H:\
> >
> > 05/15/2020  22:21                 0 IAmBackup
> > 05/15/2020  22:43    <DIR>          MyDocsBackup
> >                 1 File(s)              0 bytes
> >                 1 Dir(s)      29,638,656 bytes free
> >
> >
> >
> > K:\Windows\NtUtil>raku "say 'h://IAmBackup'.IO.e"
> > Could not open say 'h://IAmBackup'.IO.e. Failed to stat file: no such
> > file or di
> > rectory
> >
> > K:\Windows\NtUtil>raku "say 'h:/IAmBackup'.IO.e"
> > Could not open say 'h:/IAmBackup'.IO.e. Failed to stat file: no such
> > file or directory
> >
> > K:\Windows\NtUtil>raku "say 'h:\IAmBackup'.IO.e"
> > Could not open say 'h:\IAmBackup'.IO.e. Failed to stat file: no such
> > file or directory
> >
> > K:\Windows\NtUtil>raku "say 'h:\\IAmBackup'.IO.e"
> > Could not open say 'h:\\IAmBackup'.IO.e. Failed to stat file: no such
> > file or directory
> >
> >
> > And that goes for IO.d too:
> >
> > K:\Windows\NtUtil>raku "say 'h:\\MyDocsBackup'.IO.d"
> > Could not open say 'h:\\MyDocsBackup'.IO.d. Failed to stat file: no such
> > file or
> >   directory
> >
> > K:\Windows\NtUtil>raku "say 'h:\MyDocsBackup'.IO.d"
> > Could not open say 'h:\MyDocsBackup'.IO.d. Failed to stat file: no such
> > file or directory
> >
> > K:\Windows\NtUtil>raku "say 'h:/MyDocsBackup'.IO.d"
> > Could not open say 'h:/MyDocsBackup'.IO.d. Failed to stat file: no such
> > file or directory
> >
> > K:\Windows\NtUtil>raku "say 'h://MyDocsBackup'.IO.d"
> > Could not open say 'h://MyDocsBackup'.IO.d. Failed to stat file: no such
> > file or  directory
> >
> > This gets a TRIPLE:  :'(  :'(  :'(
> >
> >
> >
> > And it only works slightly better under Fedora:
> >
> > $ p6 'say "GetOptLongTest.pl6".IO.e'
> > True
> >
> > $ p6 'say "GetOptLongTest.pl7".IO.e'
> > False
> >
> > $ p6 'say "p6lib".IO.d'
> > True
> >
> > $ p6 'say "p7lib".IO.d'
> > Failed to find '/home/linuxutil/p7lib' while trying to do '.d'
> >    in block <unit> at -e line 1
> >
> > Notice that it crashed instead of returning a False.
> >
> > This gets a single :'(
> >
> > <editorial comment> AAAAAAHHHHHH!!!! </editorial comment>
> >

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

--8bLSEqNM5P+Jqlqx
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEELuenpRf8EkzxFcNUZR7vsCUn3xMFAl6/7OAACgkQZR7vsCUn
3xNJCRAAvSaR9eDqyS9fs3683V5tyYBaWdYP4QqIKhJK7vAI2ZVcZk9ep9GbiQMO
qpEORMKBzns8WMb/HfwEnluJ3vbQNp/BiOSaekmR3vpz+cYgCWwcIdlJY6btpXDF
Ytu/Tc+ecScSOsGb8PtJFoMJkLjdxdicaFiZ0RFhDdG7wlYF0Io7L0qRyJyV3Ee6
MYq190RsBJpprbII07HVv93yIh/1cmYSXtPScR1U5wu0Lg8GY4am+lBLHJop4CNX
baklpxcoV0TZQFxD6Q3x+KHufGDBF6ckWE8snW2qMgKfo57RaEpK+er7On11Si9D
rAM0zofGvcPgwIMfAVpflOlst8RNZ7ONIUJhsqPR6WS2WkzIX5kppARbXtVGtRhi
kaxTN2X7y3miOIn01FLt9TEpHqJ1sImvd6PFAKWYw8D8hjDPVTK0wOLhWVK1E/gJ
7oV3rHAEziuOfQOOJehyILOeFP3iCyqfMifyGashVSJTzMruLKaoH//fw+qoDvK7
Aq4+/zgTbqqsL8JimU00FUMeG/e5F2a2ZrNRRfXP0fiWgZgVBKNF+ci7pcC6ToTw
+lHoehUCeAdjT2nH4rkcG6kHmkbTyUBGX214LC0GA+bqixsIjNtVuzaRcaK89bWs
guDcySe/S+ll7JEZMOyOnYqrTLyy6WuV0L1qhP3hfHEy1re2SJ4=
=txKx
-----END PGP SIGNATURE-----

--8bLSEqNM5P+Jqlqx--
0
roam
5/16/2020 1:38:41 PM
 > Le sam. 16 mai 2020 =C3=A0 12:16, ToddAndMargo via perl6-users
 > <perl6-users@perl.org <mailto:perl6-users@perl.org>> a =C3=A9crit :
 >
 >     On 2020-05-15 22:30, ToddAndMargo via perl6-users wrote:
 >      > Hi All,.
 >      >
 >      > Windows 7, sp1, x64
 >      >
 >      >  >raku -v
 >      > This is Rakudo version 2020.01 built on MoarVM version
 >      > 2020.01.1 implementing Perl 6.d.
 >      >
 >      >
 >      > I am trying to get perl to tell me if a drive letter exists
 >      >
 >      > This is from Git's df command:
 >      >
 >      >  >df -kPT H:\
 >      > Filesystem     Type 1024-blocks  Used Available Capacity=20
Mounted on
 >      > H:             ntfs       38908  9964     28944      26% /h
 >      >
 >      > So, H:\ is there
 >      >
 >      >  >raku "say H:\.IO.e"
 >      > Could not open say H:\.IO.e. Failed to stat file: no such file =
or
 >     directory
 >      >
 >      > And in case I need \\
 >      >
 >      >  >raku "say H:\\.IO.e"
 >      > Could not open say H:\\.IO.e. Failed to stat file: no such file=
 or
 >      > directory
 >      >
 >      > And in case I need a forward slashL:
 >      >  >raku "say H:/.IO.e"
 >      > Could not open say H:/.IO.e. Failed to stat file: no such file =
or
 >     directory
 >      >
 >      > What am I doing wrong, this time?
 >      >
 >      > -T
 >      >
 >
 >
 >     As far as I can tell IO.e and IO.d is completely trashed
 >     in Windows:
 >
 >     K:\Windows\NtUtil>dir H:
 >        Volume in drive H is BACKUP
 >        Volume Serial Number is 00D0-CAD4
 >
 >        Directory of H:\
 >
 >     05/15/2020  22:21                 0 IAmBackup
 >     05/15/2020  22:43    <DIR>          MyDocsBackup
 >                      1 File(s)              0 bytes
 >                      1 Dir(s)      29,638,656 bytes free
 >
 >
 >
 >     K:\Windows\NtUtil>raku "say 'h://IAmBackup'.IO.e"
 >     Could not open say 'h://IAmBackup'.IO.e. Failed to stat file: no s=
uch
 >     file or di
 >     rectory
 >
 >     K:\Windows\NtUtil>raku "say 'h:/IAmBackup'.IO.e"
 >     Could not open say 'h:/IAmBackup'.IO.e. Failed to stat file: no su=
ch
 >     file or directory
 >
 >     K:\Windows\NtUtil>raku "say 'h:\IAmBackup'.IO.e"
 >     Could not open say 'h:\IAmBackup'.IO.e. Failed to stat file: no su=
ch
 >     file or directory
 >
 >     K:\Windows\NtUtil>raku "say 'h:\\IAmBackup'.IO.e"
 >     Could not open say 'h:\\IAmBackup'.IO.e. Failed to stat file: no s=
uch
 >     file or directory
 >
 >
 >     And that goes for IO.d too:
 >
 >     K:\Windows\NtUtil>raku "say 'h:\\MyDocsBackup'.IO.d"
 >     Could not open say 'h:\\MyDocsBackup'.IO.d. Failed to stat file: n=
o
 >     such
 >     file or
 >        directory
 >
 >     K:\Windows\NtUtil>raku "say 'h:\MyDocsBackup'.IO.d"
 >     Could not open say 'h:\MyDocsBackup'.IO.d. Failed to stat file:=20
no such
 >     file or directory
 >
 >     K:\Windows\NtUtil>raku "say 'h:/MyDocsBackup'.IO.d"
 >     Could not open say 'h:/MyDocsBackup'.IO.d. Failed to stat file:=20
no such
 >     file or directory
 >
 >     K:\Windows\NtUtil>raku "say 'h://MyDocsBackup'.IO.d"
 >     Could not open say 'h://MyDocsBackup'.IO.d. Failed to stat file: n=
o
 >     such
 >     file or  directory
 >
 >     This gets a TRIPLE:  :'(  :'(  :'(
 >
 >
 >
 >     And it only works slightly better under Fedora:
 >
 >     $ p6 'say "GetOptLongTest.pl6".IO.e'
 >     True
 >
 >     $ p6 'say "GetOptLongTest.pl7".IO.e'
 >     False
 >
 >     $ p6 'say "p6lib".IO.d'
 >     True
 >
 >     $ p6 'say "p7lib".IO.d'
 >     Failed to find '/home/linuxutil/p7lib' while trying to do '.d'
 >         in block <unit> at -e line 1
 >
 >     Notice that it crashed instead of returning a False.
 >
 >     This gets a single :'(
 >
 >     <editorial comment> AAAAAAHHHHHH!!!! </editorial comment>


 > On 2020-05-16 04:29, Laurent Rosenfeld via perl6-users wrote:
> Hi,
>=20
> it should be:
>=20
> $ raku *-e* "your one-liner script here"
>=20
> Best regards,
> Laurent.
>=20

Hi Laurent,

Excuse me a minute whilst I wipe some egg off my face.

mumble, mumble, mumble

Now it works


K:\Windows\NtUtil>raku -e "say 'h:/IAmBackup'.IO.e"
True

K:\Windows\NtUtil>raku -e "say 'h:/IAmNotBackup'.IO.e"
False

K:\Windows\NtUtil>raku -e "say 'h:\IAmBackup'.IO.e"
True

K:\Windows\NtUtil>raku -e "say 'h:\IAmNotBackup'.IO.e"
False


And `.d` is working better too:

K:\Windows\NtUtil>raku -e "say 'h:/MyDocsBackup'.IO.d"
True

K:\Windows\NtUtil>raku -e "say 'h:/NotMyDocsBackup'.IO.d"
Failed to find 'H:\NotMyDocsBackup' while trying to do '.d'
   in block <unit> at -e line 1

But crashing instead of giving a False makes .d worthless.

Oh but .e works on directyories too:

K:\Windows\NtUtil>raku -e "say 'h:/NotMyDocsBackup'.IO.e"
False

K:\Windows\NtUtil>raku -e "say 'h:/MyDocsBackup'.IO.e"
True

so a workaround

And .d will work if you tack a Bool at the end:

K:\Windows\NtUtil>raku -e "say 'h:/NotMyDocsBackup'.IO.d.Bool"
False

K:\Windows\NtUtil>raku -e "say 'h:/MyDocsBackup'.IO.d.Bool"
True


Thank you for the second pair of eyes!

-T

it is way more fun when I am not the one at fault
0
perl6
5/16/2020 10:04:17 PM
On 2020-05-16 05:34, Kevin Pye wrote:
> The documentation for .d states:
>=20
> Returns |True|=C2=A0if the invocant is a path that exists and is a dire=
ctory.=20
> The method will |fail| <https://docs.raku.org/routine/fail>=C2=A0with=20
> |X::IO::DoesNotExist|=C2=A0if the path points to a non-existent filesys=
tem=20
> entity.
>=20
> (and by implication False if the file exists and is not a directory). I=
n=20
> other words it is behaving exactly as specified.
>=20
> If you want to allow for the possibility that the file does not exist a=
t=20
> all, then you either need to catch the exception, or check for file=20
> existence first.
>=20
> Something like
> 'p7lib'.IO ~~ :e & :d
> might work, although I haven't tested it.
>=20
> Kevin.
>=20

Hi Keven,

I had forgotten the -e in my Windows script
as I have it build in to my alias of P6 in Linux.
It was a real egg on the face moment.

 From my point of view, IO.d giving True or crash
makes it pretty worthless.  But there are
two workaround:

IO.e also works on directories

And if you tack a .Bool on the end of IO.d it
gives you back a True or False

My notes from my perl6.IO.txt keeper:


Exists (directory):

    Warning: if you don't tack the Bool at the end, IO.d will return
             True or Crash

    Note: IO.e also works on directories and is safer to use.

    DIRPATH.IO.d.Bool;
        if not $WorkingDir.IO.d.Bool { mkdir $WorkingDir, 0o766; }
        Note: do not use {} around the variable

        $ p6 'say "zef.git".IO.d.Bool;'
        True

        >raku -e "say 'h:/NotMyDocsBackup'.IO.d.Bool"
        False

    Workaround: send your command to a batch file and run the batch file


Exists (file):
    FILEPATH.IO.e
        if  $NewFileName.IO.e { $NewFileSize =3D $NewFileName.IO.s; } els=
e=20
{ return 4; }

    Note: IO.e.Bool misses hidden files
          https://github.com/rakudo/rakudo/issues/3594

          IO.e also works on directories



-T
0
perl6
5/16/2020 10:10:05 PM
On 2020-05-16 06:38, Peter Pentchev wrote:
>> $ raku *-e* "your one-liner script here"
> And also you might want to put some quotes around the paths to let Raku
> know that those are strings and not some identifiers or something.
> 
> G'luck,
> Peter
> 

Hi Peter,

This is what goofed me up:

$ alias p5
alias p5='perl -E'

$ alias p6
alias p6='perl6 -e'

I have no such feature on the Windows side and had
forgot about it.

Also, if you tack a .Bool on the end of IO.d, you
get back True or False, instead of the useless True
or Crash.  I updates my perl6.IO.txt keeper file.

And IO.e also works for directories

-T
0
perl6
5/16/2020 10:19:05 PM
--Cx6gHIjlhIvUM2fk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, May 16, 2020 at 03:19:05PM -0700, ToddAndMargo via perl6-users wrot=
e:
> On 2020-05-16 06:38, Peter Pentchev wrote:
> > > $ raku *-e* "your one-liner script here"
> > And also you might want to put some quotes around the paths to let Raku
> > know that those are strings and not some identifiers or something.
> >=20
> > G'luck,
> > Peter
> >=20
>=20
> Hi Peter,
>=20
> This is what goofed me up:
>=20
> $ alias p5
> alias p5=3D'perl -E'
>=20
> $ alias p6
> alias p6=3D'perl6 -e'
>=20
> I have no such feature on the Windows side and had
> forgot about it.
>=20
> Also, if you tack a .Bool on the end of IO.d, you
> get back True or False, instead of the useless True
> or Crash.  I updates my perl6.IO.txt keeper file.
>=20
> And IO.e also works for directories

What you're doing with "tacking .Bool at the end" is usually not
necessary to do explicitly, because most people do not "say" the result
of .d or .e, but use it in an if, for, while or some such conditional
statement, in which case Raku automatically converts the expression to
a boolean, i.e. tacks a .Bool at the end.

The reason .d and .e return a failure otherwise is that in some cases
they may be used not in a conditional statement, but as a kind of
assertion - "I really, really think that at this point this variable
should contain a valid path to an existing directory, but if something
went wrong in my program and the variable does not contain that, I do
not want the program to go on, it would be useless, I *want* it to raise
an exception when the value is used". At least that's what I think;
I *know* that the people who rewrote .IO in v6.d are on this list, so
please correct me if I'm wrong :)

But the most common use of .d, .e, .f and similar, the most common by
a very large margin, is in conditionals, where Raku does the conversion
to a boolean value automatically.

G'luck,
Peter

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

--Cx6gHIjlhIvUM2fk
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEELuenpRf8EkzxFcNUZR7vsCUn3xMFAl7AiM0ACgkQZR7vsCUn
3xM4RBAAunAlx22l8JvYLZpzTZDBNYa5kjexE65I37piqvjXvv7xNla2Wpy7sfRF
fIhCEM8c1tdJCuKht8cCQVeX4htoeDXOgCsTJTfVYD42QKYtlLRN34u11o6jCIW1
ZXF+FYKE/GmwtkP8sGtGhF1NOGlW8quH+OAvHqX/mA45sl0Eu3Jr5b0F/nQ2KR1V
O9Lji4radevUmE0otsq+pHsJNq1OoYOZ1dSE2v7f/gzAodkjtE653Ti5fAevCkz1
lLO8O6zFSLJfgYa0YtAHs1gXyBZ1K8Y7anX0Di0EIEb/1mCTroVnY70IdjQJiZQW
y7TZVeQu0eWD0rnSmRv1ZizNPaN+k9FXtRVWtjyHtfIVb1omx7DaDOObjX5/mba3
XUXcxppx1fwaAChOU5aLPd/lgveaLFd15xYsNu5ZiSqM9HGbpWu/M+tTqqMFG1eV
laPblmA9jAizrVrL3OrXtS1i58w8leBZFN8HKArxjfOQfzsmD3niLI9AAPP4Xtc7
v1ecSuOGC+kliXm1AoEldyramM83REp7XzvLbo+S/fo7HQYqf1bM390NTu45G0Eb
zF2wp/zCv6ySg14jX8sp/asqKqUv8cYXYRWvqE+FWSD9WDhxhwRVSYdwl0QrpJM/
sPVG+FP3vBrexEqAewlqxBEgzcYk+EQA0daYcrMO59qKuvPlXI4=
=KPAT
-----END PGP SIGNATURE-----

--Cx6gHIjlhIvUM2fk--
0
roam
5/17/2020 12:44:03 AM
On 2020-05-16 17:44, Peter Pentchev wrote:
> On Sat, May 16, 2020 at 03:19:05PM -0700, ToddAndMargo via perl6-users wrote:
>> On 2020-05-16 06:38, Peter Pentchev wrote:
>>>> $ raku *-e* "your one-liner script here"
>>> And also you might want to put some quotes around the paths to let Raku
>>> know that those are strings and not some identifiers or something.
>>>
>>> G'luck,
>>> Peter
>>>
>>
>> Hi Peter,
>>
>> This is what goofed me up:
>>
>> $ alias p5
>> alias p5='perl -E'
>>
>> $ alias p6
>> alias p6='perl6 -e'
>>
>> I have no such feature on the Windows side and had
>> forgot about it.
>>
>> Also, if you tack a .Bool on the end of IO.d, you
>> get back True or False, instead of the useless True
>> or Crash.  I updates my perl6.IO.txt keeper file.
>>
>> And IO.e also works for directories
> 
> What you're doing with "tacking .Bool at the end" is usually not
> necessary to do explicitly, because most people do not "say" the result
> of .d or .e, but use it in an if, for, while or some such conditional
> statement, in which case Raku automatically converts the expression to
> a boolean, i.e. tacks a .Bool at the end.
> 
> The reason .d and .e return a failure otherwise is that in some cases
> they may be used not in a conditional statement, but as a kind of
> assertion - "I really, really think that at this point this variable
> should contain a valid path to an existing directory, but if something
> went wrong in my program and the variable does not contain that, I do
> not want the program to go on, it would be useless, I *want* it to raise
> an exception when the value is used". At least that's what I think;
> I *know* that the people who rewrote .IO in v6.d are on this list, so
> please correct me if I'm wrong :)
> 
> But the most common use of .d, .e, .f and similar, the most common by
> a very large margin, is in conditionals, where Raku does the conversion
> to a boolean value automatically.
> 
> G'luck,
> Peter
> 

Hi Peter,

My big issues is that  want to check to see if something
is there, then take appropriate measures based on what
I am doing.  Crashing is not what I want.  If I should
exit based on what I find, I want the control over it.

In my "if" statements, I will use Bool anyway as it
will force the issue. And will alert me that there
is something else going on that I should be aware of
(fail).

Now I have to look up f.

Found it.  If you use the Bool, it returns a False
for directories.   Cool.

Thank you for the detailed explanation.  Very useful
and helpful!


Just out of curiosity

      https://docs.raku.org/routine/d
      (IO::Path) method d
      Defined as:

      method d(--> Bool:D)

      Returns True if the invocant is a path that
      exists and is a directory. The method will
      fail with X::IO::DoesNotExist if the path points to
      a non-existent filesystem entity.

Where in the definition
     method d(--> Bool:D)
does it state True or Fail?  It states "Bool".  Is
something missing?

-T
0
perl6
5/17/2020 1:57:53 AM
--FCPLy5NpE1Kdjj9y
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, May 16, 2020 at 06:57:53PM -0700, ToddAndMargo via perl6-users wrot=
e:
> On 2020-05-16 17:44, Peter Pentchev wrote:
> > On Sat, May 16, 2020 at 03:19:05PM -0700, ToddAndMargo via perl6-users =
wrote:
> > > On 2020-05-16 06:38, Peter Pentchev wrote:
> > > > > $ raku *-e* "your one-liner script here"
> > > > And also you might want to put some quotes around the paths to let =
Raku
> > > > know that those are strings and not some identifiers or something.
> > > >=20
> > > > G'luck,
> > > > Peter
> > > >=20
> > >=20
> > > Hi Peter,
> > >=20
> > > This is what goofed me up:
> > >=20
> > > $ alias p5
> > > alias p5=3D'perl -E'
> > >=20
> > > $ alias p6
> > > alias p6=3D'perl6 -e'
> > >=20
> > > I have no such feature on the Windows side and had
> > > forgot about it.
> > >=20
> > > Also, if you tack a .Bool on the end of IO.d, you
> > > get back True or False, instead of the useless True
> > > or Crash.  I updates my perl6.IO.txt keeper file.
> > >=20
> > > And IO.e also works for directories
> >=20
> > What you're doing with "tacking .Bool at the end" is usually not
> > necessary to do explicitly, because most people do not "say" the result
> > of .d or .e, but use it in an if, for, while or some such conditional
> > statement, in which case Raku automatically converts the expression to
> > a boolean, i.e. tacks a .Bool at the end.
> >=20
> > The reason .d and .e return a failure otherwise is that in some cases
> > they may be used not in a conditional statement, but as a kind of
> > assertion - "I really, really think that at this point this variable
> > should contain a valid path to an existing directory, but if something
> > went wrong in my program and the variable does not contain that, I do
> > not want the program to go on, it would be useless, I *want* it to raise
> > an exception when the value is used". At least that's what I think;
> > I *know* that the people who rewrote .IO in v6.d are on this list, so
> > please correct me if I'm wrong :)
> >=20
> > But the most common use of .d, .e, .f and similar, the most common by
> > a very large margin, is in conditionals, where Raku does the conversion
> > to a boolean value automatically.
> >=20
> > G'luck,
> > Peter
> >=20
>=20
> Hi Peter,
>=20
> My big issues is that  want to check to see if something
> is there, then take appropriate measures based on what
> I am doing.  Crashing is not what I want.  If I should
> exit based on what I find, I want the control over it.

So use .d in a boolean context (if, while, etc).

> In my "if" statements, I will use Bool anyway as it
> will force the issue. And will alert me that there
> is something else going on that I should be aware of
> (fail).

That's *exactly* the opposite of what I thought I explained, but
you do you, I guess.

> Now I have to look up f.
>=20
> Found it.  If you use the Bool, it returns a False
> for directories.   Cool.

It is documented to return true for files, so yes, it would return false
for directories.

> Thank you for the detailed explanation.  Very useful
> and helpful!
>=20
>=20
> Just out of curiosity
>=20
>      https://docs.raku.org/routine/d
>      (IO::Path) method d
>      Defined as:
>=20
>      method d(--> Bool:D)
>=20
>      Returns True if the invocant is a path that
>      exists and is a directory. The method will
>      fail with X::IO::DoesNotExist if the path points to
>      a non-existent filesystem entity.
>=20
> Where in the definition
>     method d(--> Bool:D)
> does it state True or Fail?  It states "Bool".  Is
> something missing?

The definition does not list all the exceptions that a method or
function can throw, and for good reason - people have learned their
lessons from the Java world, where this, while it did have some very
limited use, very quickly drove programmers to just say "... raises
Exception" on everything, making it essentially useless.

OK, in more words for people who may not have any Java programming
experience: they tried to make programmers list any exceptions that may
be raised from their methods, with the expectation that programmers
would check the documentation for any exceptions raised by the functions
and methods that they call, decide which ones they want to handle and
which ones they want to propagate upwards, and then list the ones that
they propatage and the ones that they raise themselves. However, in some
cases, like when using several library functions from several
third-party libraries, it turned out that the programmer said "oh come
on, I can't keep up with all the changes they make to their libraries,
they keep adding more and more exceptions; nah, I'll just say that my
method can throw *any* kind of exception under the Sun and be done with
it!".

Now Rust and Go are trying almost the same thing, but in a better way,
although I've seen the "propagate it, I don't care what it is!"
mentality  in both Rust ("just do .unwrap(), who cares") and Go ("is the
returned value an error? if so, return/propagate it, I don't care!")
programs (not all of them, of course).

I think that proper documentation is a better way than forcing
declarations of the errors returned, and that's what Raku does.
It does not list the exception in the method, it talks about it in
the text description.  Of course, if the Raku development team has more
insights in why they chose this way, and the reasons are not what
I wrote here, please correct me :)

G'luck,
Peter

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

--FCPLy5NpE1Kdjj9y
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEELuenpRf8EkzxFcNUZR7vsCUn3xMFAl7A9IwACgkQZR7vsCUn
3xMPtQ/+L02NgpANu7xihTQsFGbmTDQDSVheoDCUC91a8I61hTntN1w7iNh74e2p
zi362uuA9HUF798Bnn0dHFhKomo7epbI7YEU+v8sOMrHwchg6Wc9yNwoNz3s3kZX
PpZ0upqlUCmTBv3oj6y1igK1gq+3zl3u2t6E6uKZYL8+i4sWnAiTM2Zdf48wdoSQ
kgMIGJXX2XunZi4m0stgL9t5GWKUGZL30GdpdHp0u2mj4pzh3RCUV1zx2uhHT3dL
vISenveCr0n3HFu9ke2y6wa58m9Q8dTFmFOVU19dJCpFF/fRgdOuFknYJ/isuvk+
4DmR+q+L7VT1R89KGO2UqfU1/I5o7bE3DjBJiqy10mmHIVmF8XGSFvRZAAmg4nBS
/8r2DPXIMJ/Rz5ow8tHWkSkFUu4tJ5NfilBACx/qB+8NeOT3w1IpsiLybqqvlYQf
IkYW4Gc4DOL4Syl6zOWL+rVohbKUqHGArg3+5QvOjhMvmRP/0Ju3Ed5becymgo2+
ijha8dNt238POCPh0lQyGmlqWxMwYOdiLVVRINf/3VWiuIZoc+YSqJcUr6I0VEOO
o0yji5Ef0JOzVKrcljey5PrIOZhltIxfaBVFLt3+5178BjlhagsKUbAxzIgRksV+
Uv6XX98NBuRF6tb/7timUP78ou0cuonw8S0SYOiCqs7ohNtQtSk=
=D9I2
-----END PGP SIGNATURE-----

--FCPLy5NpE1Kdjj9y--
0
roam
5/17/2020 8:23:45 AM
On 2020-05-17 01:23, Peter Pentchev wrote:
> On Sat, May 16, 2020 at 06:57:53PM -0700, ToddAndMargo via perl6-users wrote:
>> On 2020-05-16 17:44, Peter Pentchev wrote:
>>> On Sat, May 16, 2020 at 03:19:05PM -0700, ToddAndMargo via perl6-users wrote:
>>>> On 2020-05-16 06:38, Peter Pentchev wrote:
>>>>>> $ raku *-e* "your one-liner script here"
>>>>> And also you might want to put some quotes around the paths to let Raku
>>>>> know that those are strings and not some identifiers or something.
>>>>>
>>>>> G'luck,
>>>>> Peter
>>>>>
>>>>
>>>> Hi Peter,
>>>>
>>>> This is what goofed me up:
>>>>
>>>> $ alias p5
>>>> alias p5='perl -E'
>>>>
>>>> $ alias p6
>>>> alias p6='perl6 -e'
>>>>
>>>> I have no such feature on the Windows side and had
>>>> forgot about it.
>>>>
>>>> Also, if you tack a .Bool on the end of IO.d, you
>>>> get back True or False, instead of the useless True
>>>> or Crash.  I updates my perl6.IO.txt keeper file.
>>>>
>>>> And IO.e also works for directories
>>>
>>> What you're doing with "tacking .Bool at the end" is usually not
>>> necessary to do explicitly, because most people do not "say" the result
>>> of .d or .e, but use it in an if, for, while or some such conditional
>>> statement, in which case Raku automatically converts the expression to
>>> a boolean, i.e. tacks a .Bool at the end.
>>>
>>> The reason .d and .e return a failure otherwise is that in some cases
>>> they may be used not in a conditional statement, but as a kind of
>>> assertion - "I really, really think that at this point this variable
>>> should contain a valid path to an existing directory, but if something
>>> went wrong in my program and the variable does not contain that, I do
>>> not want the program to go on, it would be useless, I *want* it to raise
>>> an exception when the value is used". At least that's what I think;
>>> I *know* that the people who rewrote .IO in v6.d are on this list, so
>>> please correct me if I'm wrong :)
>>>
>>> But the most common use of .d, .e, .f and similar, the most common by
>>> a very large margin, is in conditionals, where Raku does the conversion
>>> to a boolean value automatically.
>>>
>>> G'luck,
>>> Peter
>>>
>>
>> Hi Peter,
>>
>> My big issues is that  want to check to see if something
>> is there, then take appropriate measures based on what
>> I am doing.  Crashing is not what I want.  If I should
>> exit based on what I find, I want the control over it.
> 
> So use .d in a boolean context (if, while, etc).
> 
>> In my "if" statements, I will use Bool anyway as it
>> will force the issue. And will alert me that there
>> is something else going on that I should be aware of
>> (fail).
> 
> That's *exactly* the opposite of what I thought I explained, but
> you do you, I guess.
> 
>> Now I have to look up f.
>>
>> Found it.  If you use the Bool, it returns a False
>> for directories.   Cool.
> 
> It is documented to return true for files, so yes, it would return false
> for directories.
> 
>> Thank you for the detailed explanation.  Very useful
>> and helpful!
>>
>>
>> Just out of curiosity
>>
>>       https://docs.raku.org/routine/d
>>       (IO::Path) method d
>>       Defined as:
>>
>>       method d(--> Bool:D)
>>
>>       Returns True if the invocant is a path that
>>       exists and is a directory. The method will
>>       fail with X::IO::DoesNotExist if the path points to
>>       a non-existent filesystem entity.
>>
>> Where in the definition
>>      method d(--> Bool:D)
>> does it state True or Fail?  It states "Bool".  Is
>> something missing?
> 
> The definition does not list all the exceptions that a method or
> function can throw, and for good reason - people have learned their
> lessons from the Java world, where this, while it did have some very
> limited use, very quickly drove programmers to just say "... raises
> Exception" on everything, making it essentially useless.
> 
> OK, in more words for people who may not have any Java programming
> experience: they tried to make programmers list any exceptions that may
> be raised from their methods, with the expectation that programmers
> would check the documentation for any exceptions raised by the functions
> and methods that they call, decide which ones they want to handle and
> which ones they want to propagate upwards, and then list the ones that
> they propatage and the ones that they raise themselves. However, in some
> cases, like when using several library functions from several
> third-party libraries, it turned out that the programmer said "oh come
> on, I can't keep up with all the changes they make to their libraries,
> they keep adding more and more exceptions; nah, I'll just say that my
> method can throw *any* kind of exception under the Sun and be done with
> it!".
> 
> Now Rust and Go are trying almost the same thing, but in a better way,
> although I've seen the "propagate it, I don't care what it is!"
> mentality  in both Rust ("just do .unwrap(), who cares") and Go ("is the
> returned value an error? if so, return/propagate it, I don't care!")
> programs (not all of them, of course).
> 
> I think that proper documentation is a better way than forcing
> declarations of the errors returned, and that's what Raku does.
> It does not list the exception in the method, it talks about it in
> the text description.  Of course, if the Raku development team has more
> insights in why they chose this way, and the reasons are not what
> I wrote here, please correct me :)
> 
> G'luck,
> Peter
> 

Hi Peter,

    Gee Wiz, all I want back is a yes or no answer.
That exception stuff irritates when I get it back.
Tacking .Bool at the end insures I will always get
back a yes or no answer

Thank you for the wonderful explanation.

-T
0
perl6
5/17/2020 9:18:30 AM
--q/d9vTEvvdeKbPNw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, May 17, 2020 at 02:18:30AM -0700, ToddAndMargo via perl6-users wrot=
e:
> On 2020-05-17 01:23, Peter Pentchev wrote:
> > On Sat, May 16, 2020 at 06:57:53PM -0700, ToddAndMargo via perl6-users =
wrote:
> > > On 2020-05-16 17:44, Peter Pentchev wrote:
> > > > On Sat, May 16, 2020 at 03:19:05PM -0700, ToddAndMargo via perl6-us=
ers wrote:
> > > > > On 2020-05-16 06:38, Peter Pentchev wrote:
> > > > > > > $ raku *-e* "your one-liner script here"
> > > > > > And also you might want to put some quotes around the paths to =
let Raku
> > > > > > know that those are strings and not some identifiers or somethi=
ng.
> > > > > >=20
> > > > > > G'luck,
> > > > > > Peter
> > > > > >=20
> > > > >=20
> > > > > Hi Peter,
> > > > >=20
> > > > > This is what goofed me up:
> > > > >=20
> > > > > $ alias p5
> > > > > alias p5=3D'perl -E'
> > > > >=20
> > > > > $ alias p6
> > > > > alias p6=3D'perl6 -e'
> > > > >=20
> > > > > I have no such feature on the Windows side and had
> > > > > forgot about it.
> > > > >=20
> > > > > Also, if you tack a .Bool on the end of IO.d, you
> > > > > get back True or False, instead of the useless True
> > > > > or Crash.  I updates my perl6.IO.txt keeper file.
> > > > >=20
> > > > > And IO.e also works for directories
> > > >=20
> > > > What you're doing with "tacking .Bool at the end" is usually not
> > > > necessary to do explicitly, because most people do not "say" the re=
sult
> > > > of .d or .e, but use it in an if, for, while or some such condition=
al
> > > > statement, in which case Raku automatically converts the expression=
 to
> > > > a boolean, i.e. tacks a .Bool at the end.
> > > >=20
> > > > The reason .d and .e return a failure otherwise is that in some cas=
es
> > > > they may be used not in a conditional statement, but as a kind of
> > > > assertion - "I really, really think that at this point this variable
> > > > should contain a valid path to an existing directory, but if someth=
ing
> > > > went wrong in my program and the variable does not contain that, I =
do
> > > > not want the program to go on, it would be useless, I *want* it to =
raise
> > > > an exception when the value is used". At least that's what I think;
> > > > I *know* that the people who rewrote .IO in v6.d are on this list, =
so
> > > > please correct me if I'm wrong :)
> > > >=20
> > > > But the most common use of .d, .e, .f and similar, the most common =
by
> > > > a very large margin, is in conditionals, where Raku does the conver=
sion
> > > > to a boolean value automatically.
> > > >=20
> > > > G'luck,
> > > > Peter
> > > >=20
> > >=20
> > > Hi Peter,
> > >=20
> > > My big issues is that  want to check to see if something
> > > is there, then take appropriate measures based on what
> > > I am doing.  Crashing is not what I want.  If I should
> > > exit based on what I find, I want the control over it.
> >=20
> > So use .d in a boolean context (if, while, etc).
> >=20
> > > In my "if" statements, I will use Bool anyway as it
> > > will force the issue. And will alert me that there
> > > is something else going on that I should be aware of
> > > (fail).
> >=20
> > That's *exactly* the opposite of what I thought I explained, but
> > you do you, I guess.
> >=20
> > > Now I have to look up f.
> > >=20
> > > Found it.  If you use the Bool, it returns a False
> > > for directories.   Cool.
> >=20
> > It is documented to return true for files, so yes, it would return false
> > for directories.
> >=20
> > > Thank you for the detailed explanation.  Very useful
> > > and helpful!
> > >=20
> > >=20
> > > Just out of curiosity
> > >=20
> > >       https://docs.raku.org/routine/d
> > >       (IO::Path) method d
> > >       Defined as:
> > >=20
> > >       method d(--> Bool:D)
> > >=20
> > >       Returns True if the invocant is a path that
> > >       exists and is a directory. The method will
> > >       fail with X::IO::DoesNotExist if the path points to
> > >       a non-existent filesystem entity.
> > >=20
> > > Where in the definition
> > >      method d(--> Bool:D)
> > > does it state True or Fail?  It states "Bool".  Is
> > > something missing?
> >=20
> > The definition does not list all the exceptions that a method or
> > function can throw, and for good reason - people have learned their
> > lessons from the Java world, where this, while it did have some very
> > limited use, very quickly drove programmers to just say "... raises
> > Exception" on everything, making it essentially useless.
> >=20
> > OK, in more words for people who may not have any Java programming
> > experience: they tried to make programmers list any exceptions that may
> > be raised from their methods, with the expectation that programmers
> > would check the documentation for any exceptions raised by the functions
> > and methods that they call, decide which ones they want to handle and
> > which ones they want to propagate upwards, and then list the ones that
> > they propatage and the ones that they raise themselves. However, in some
> > cases, like when using several library functions from several
> > third-party libraries, it turned out that the programmer said "oh come
> > on, I can't keep up with all the changes they make to their libraries,
> > they keep adding more and more exceptions; nah, I'll just say that my
> > method can throw *any* kind of exception under the Sun and be done with
> > it!".
> >=20
> > Now Rust and Go are trying almost the same thing, but in a better way,
> > although I've seen the "propagate it, I don't care what it is!"
> > mentality  in both Rust ("just do .unwrap(), who cares") and Go ("is the
> > returned value an error? if so, return/propagate it, I don't care!")
> > programs (not all of them, of course).
> >=20
> > I think that proper documentation is a better way than forcing
> > declarations of the errors returned, and that's what Raku does.
> > It does not list the exception in the method, it talks about it in
> > the text description.  Of course, if the Raku development team has more
> > insights in why they chose this way, and the reasons are not what
> > I wrote here, please correct me :)
> >=20
> > G'luck,
> > Peter
> >=20
>=20
> Hi Peter,
>=20
>    Gee Wiz, all I want back is a yes or no answer.
> That exception stuff irritates when I get it back.
> Tacking .Bool at the end insures I will always get
> back a yes or no answer

You said that you would tack Bool at the end in "if" statements, too.
I don't know how to tell you more clearly that you do not need to do
that.

G'luck,
Peter

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

--q/d9vTEvvdeKbPNw
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEELuenpRf8EkzxFcNUZR7vsCUn3xMFAl7BBDMACgkQZR7vsCUn
3xOMXRAAzHMjhIoLgCNC9P/SHrVY6XduHsXgwjxe98F5nUyDU42e8fdC5bQVmBly
h2QLwjdv82BlpbRQGgBxkkzUkuSdnSELIn98NPWT9ljxsWNI3RAW+YoA3Bihln7X
lycOHo9EYQWG/pW023Zn7lkCMX5/dJkWSA0xP1lTngVBQxf5OyCt73ElDvzxnQNm
RtXLWo3rA3pdPGqxwX9AOYFWpriE0OuNJ7O5GeZTab5P78ucHfN0+FyPBlnaRYX6
P3W7yyP0YbePjUD7zfhAarn4Zlij43gN2MvrHZ82dRt05okNL8breWollXdzdb/j
+Yztjsqy1wfOYtD926R8G19vmWAO+lX/T+O8cWqCP+0f91A92N/Z4CX1RWJQBZmk
5iSh5dryhZtjekuCBbxXv8mRbtLcJ7Ib8pY/VqXld5wNeoCyXNu01bJepGw6pCaj
/EIPEg86jhdzSfhUIy0Cvy9CT+S02/rX8U5hydlcxKRbwbYsQcVq0HcE779s/dC5
JePBhtGRMfw723weZK7yvp3UcOwcc6LzibfvEfsicTkH/LXuDkqb7XU5wvVvTKKJ
wJTyRXuiztwi/32u76fn+nrHjGmf+g053XkSLX+lREeLtku1EoyCR+8QDlQKY4GI
1JxkTZdKSG7AAV1eUdL6A+6h1IUQDjLXgZwx1bwLsTHUBErrVZo=
=BAC0
-----END PGP SIGNATURE-----

--q/d9vTEvvdeKbPNw--
0
roam
5/17/2020 9:30:33 AM
On 2020-05-17 02:30, Peter Pentchev wrote:
> You said that you would tack Bool at the end in "if" statements, too.

Hi Peter,

No wonder.  I do not remember saying that, but I could
have.  My `if` statements look like:

    if not  "%Options<Path>".IO.d.Bool  {
       say "Creating %Options<Path>";
       mkdir( %Options<Path>", 0o777 );
    }

I definitely do not tack .Bool onto the end
of my `if` statements.

Thank you for your patience!

-T
0
perl6
5/17/2020 10:01:34 AM
--5wdX5gfZV4kojQYf
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, May 17, 2020 at 03:01:34AM -0700, ToddAndMargo via perl6-users wrot=
e:
> On 2020-05-17 02:30, Peter Pentchev wrote:
> > You said that you would tack Bool at the end in "if" statements, too.
>=20
> Hi Peter,
>=20
> No wonder.  I do not remember saying that, but I could
> have.  My `if` statements look like:
>=20
>    if not  "%Options<Path>".IO.d.Bool  {
>       say "Creating %Options<Path>";
>       mkdir( %Options<Path>", 0o777 );
>    }
>=20
> I definitely do not tack .Bool onto the end
> of my `if` statements.

Uh. That's exactly what you're doing. You do *not* need the .Bool
there at the end. The "not" makes Raku convert whatever is there
to a boolean, so the .Bool is implicit. And if you were to check
the other way, if you had "if $foo.IO.d { ... }", then the "if"
makes Raku convert whatever is there to a boolean, so the .Bool is
implicit. You do not need to put the .Bool in an "if" or a "while"
statement.

G'luck,
Peter

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

--5wdX5gfZV4kojQYf
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEELuenpRf8EkzxFcNUZR7vsCUn3xMFAl7BE7MACgkQZR7vsCUn
3xMD7BAAmZwstU7xabDcxw0parDEgvQRtJYARjKZLMpiaLrSXUW1zUUwPsksnKkb
fTtH5DcmmZINjb+TvmhxShB/XQwKqjhSXF83zYsBw0dY5PqiIL8D8+d5iqGWXufA
yjaq1Onh0cBl5ArN5E6Pr62GuQRCEoBW4ykk5xn35sO/y8miXEyvbTc4i3sT3ZOJ
pPzjFmEDACyTq4pAUX6d6Wg1MFay16u0ISw3qrpQy80BWgP/BoLkp+ocCjtJKlNZ
x1gNBSvBDEqz87qmeybmrPtVf2Vp6HisALVkCcmbVCdn9y3D5d05bLT4iGEDmIK3
4G0K9FUxQv8N1bSNaIYgHWE1oQHQJ5MvrjzhJbwDqt6SyrypjJB/djIXeeRHaWpV
BHxUTTRsEjM0kCuVyIm/5rVTmISmOH08xvjKmgxg4nd7VDHvjswJGh0uLkspIlHR
WfxKnQCAfP8EoiST1OLMdJ9mtN/wqO+Gx8r7PzKqcFXULnRugg4aGbOH4k51Z7C4
r2rWiAbpYq8HxRRRPiesXmW7C3QTrFYiy6HkNgLW6qxwYI3jKWtsGM8cROO5bomp
dbCr/hXsu75DuDOd8xjH8/Gp4CMSW82jwK9sWEF/fQJDiOQaFBBZ0HaYKqOXWykK
JRctoDDdvy0/5yAZtVHC07/DsY0L5TDXQ/LXFvqUtqIXOwJv/YY=
=yo+g
-----END PGP SIGNATURE-----

--5wdX5gfZV4kojQYf--
0
roam
5/17/2020 10:36:40 AM
[11:50:21] <lizmat>	you don.t need the .Bool, .e already returns a =
Bool
[11:53:07] <ToddAndMargo>	sometimes IO.someletter returns True of =
Fail, not False.  Tacking .Bool on the end, means I don't have to =
remember which ones
[11:57:23] <ToddAndMargo>	True or Fail.  Typo
[11:58:21] <lizmat>	A Failure is always false
[12:03:02] <ToddAndMargo>	A Fail is a lot more than that.  here is =
an example:  >raku -e "say Q[z:\].IO.d;"Failed to find 'Z:\' while =
trying to do '.d'  in block <unit> at -e line 1
[12:04:16] <ToddAndMargo>	I use .bool at the end because I only =
want back a yes or no answer.  And I certainly don't want it to crash.  =
Always using .Bool keeps me out of trouble
[12:19:21] <lizmat>	say "directory foo exists" if "foo".IO.d
[12:19:49] <lizmat>	you don't have to worry about Failure then, =
which is the point of Failure to begin with
[12:23:33] <ToddAndMargo>	That is `if` converting the =
`X::IO::DoesNotExist` clutter into False for me.  I never know when that =
will happen and when it won't, so tacking .Bool at the end keeps me out =
of trouble.  I am not a purest here.  I do not mind seeing .Bool at the =
end.   It also tells me I will be seeing a Boolean.
[12:28:42] <ToddAndMargo>	bye bye for now. Thank you all for the =
tips!

> On 17 May 2020, at 12:36, Peter Pentchev <roam@ringlet.net> wrote:
>=20
> On Sun, May 17, 2020 at 03:01:34AM -0700, ToddAndMargo via perl6-users =
wrote:
>> On 2020-05-17 02:30, Peter Pentchev wrote:
>>> You said that you would tack Bool at the end in "if" statements, =
too.
>>=20
>> Hi Peter,
>>=20
>> No wonder.  I do not remember saying that, but I could
>> have.  My `if` statements look like:
>>=20
>>   if not  "%Options<Path>".IO.d.Bool  {
>>      say "Creating %Options<Path>";
>>      mkdir( %Options<Path>", 0o777 );
>>   }
>>=20
>> I definitely do not tack .Bool onto the end
>> of my `if` statements.
>=20
> Uh. That's exactly what you're doing. You do *not* need the .Bool
> there at the end. The "not" makes Raku convert whatever is there
> to a boolean, so the .Bool is implicit. And if you were to check
> the other way, if you had "if $foo.IO.d { ... }", then the "if"
> makes Raku convert whatever is there to a boolean, so the .Bool is
> implicit. You do not need to put the .Bool in an "if" or a "while"
> statement.
>=20
> G'luck,
> Peter
>=20
> --=20
> Peter Pentchev  roam@ringlet.net roam@debian.org pp@storpool.com
> PGP key:        http://people.FreeBSD.org/~roam/roam.key.asc
> Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13
0
liz
5/17/2020 10:50:49 AM
On 2020-05-17 03:36, Peter Pentchev wrote:
> On Sun, May 17, 2020 at 03:01:34AM -0700, ToddAndMargo via perl6-users wrote:
>> On 2020-05-17 02:30, Peter Pentchev wrote:
>>> You said that you would tack Bool at the end in "if" statements, too.
>>
>> Hi Peter,
>>
>> No wonder.  I do not remember saying that, but I could
>> have.  My `if` statements look like:
>>
>>     if not  "%Options<Path>".IO.d.Bool  {
>>        say "Creating %Options<Path>";
>>        mkdir( %Options<Path>", 0o777 );
>>     }
>>
>> I definitely do not tack .Bool onto the end
>> of my `if` statements.
> 
> Uh. That's exactly what you're doing. You do *not* need the .Bool
> there at the end. The "not" makes Raku convert whatever is there
> to a boolean, so the .Bool is implicit. And if you were to check
> the other way, if you had "if $foo.IO.d { ... }", then the "if"
> makes Raku convert whatever is there to a boolean, so the .Bool is
> implicit. You do not need to put the .Bool in an "if" or a "while"
> statement.
> 
> G'luck,
> Peter
> 

Hi Peter,

Brad asked me the same thing on another thread.  This is what I
told him:

Hi Brad,

I do this because it keeps me out of trouble.

I want back a yes or no answer, not True or Fail
(X::IO::DoesNotExist).

And I never remember which IO.<some_letter> will return
a True or Fail or which functions (`if` does) will
convert X::IO::DoesNotExist to a False for me.

Plus it makes it more readable for me.
    [something].IO.<someletter>.Bool
tells me instantly I will be getting back a yes
or no answer.

So if you want to be a purist, you can experiment with
which IO.<some_letter> are going to give you a yes
or no answer or which functions will convert X::IO::DoesNotExist for 
you.  OR you can just tack .Bool
at the end and forgo the hair pulling.

Also the cryptograms in the documentation are not
correct.  For instance:

     https://docs.raku.org/routine/d

     method d(--> Bool:D)

Says it return a "Bool" not a "True" or "X::IO::DoesNotExist".
The modification to Bool is stated at the bottom of the page.

So, basically, it is to keeps me out of trouble.  And if
I am going to get `X::IO::DoesNotExist` back instead of
a Boolean, .Bool automatically converts it for me and
with no hair pulling.

So, basically, my LONG WINDED answer is that I do it for me.

-T
0
perl6
5/17/2020 7:12:51 PM
On 2020-05-17 03:50, Elizabeth Mattijsen wrote:
> [11:50:21] <lizmat>	you don.t need the .Bool, .e already returns a Bool
> [11:53:07] <ToddAndMargo>	sometimes IO.someletter returns True of Fail, not False.  Tacking .Bool on the end, means I don't have to remember which ones
> [11:57:23] <ToddAndMargo>	True or Fail.  Typo
> [11:58:21] <lizmat>	A Failure is always false
> [12:03:02] <ToddAndMargo>	A Fail is a lot more than that.  here is an example:  >raku -e "say Q[z:\].IO.d;"Failed to find 'Z:\' while trying to do '.d'  in block <unit> at -e line 1
> [12:04:16] <ToddAndMargo>	I use .bool at the end because I only want back a yes or no answer.  And I certainly don't want it to crash.  Always using .Bool keeps me out of trouble
> [12:19:21] <lizmat>	say "directory foo exists" if "foo".IO.d
> [12:19:49] <lizmat>	you don't have to worry about Failure then, which is the point of Failure to begin with
> [12:23:33] <ToddAndMargo>	That is `if` converting the `X::IO::DoesNotExist` clutter into False for me.  I never know when that will happen and when it won't, so tacking .Bool at the end keeps me out of trouble.  I am not a purest here.  I do not mind seeing .Bool at the end.   It also tells me I will be seeing a Boolean.
> [12:28:42] <ToddAndMargo>	bye bye for now. Thank you all for the tips!

Yup,  That is it.  Keep me from having to pull my hair out.
0
perl6
5/17/2020 7:14:39 PM
--UugvWAfsgieZRqgk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, May 17, 2020 at 12:12:51PM -0700, ToddAndMargo via perl6-users wrot=
e:
> On 2020-05-17 03:36, Peter Pentchev wrote:
> > On Sun, May 17, 2020 at 03:01:34AM -0700, ToddAndMargo via perl6-users =
wrote:
> > > On 2020-05-17 02:30, Peter Pentchev wrote:
> > > > You said that you would tack Bool at the end in "if" statements, to=
o.
> > >=20
> > > Hi Peter,
> > >=20
> > > No wonder.  I do not remember saying that, but I could
> > > have.  My `if` statements look like:
> > >=20
> > >     if not  "%Options<Path>".IO.d.Bool  {
> > >        say "Creating %Options<Path>";
> > >        mkdir( %Options<Path>", 0o777 );
> > >     }
> > >=20
> > > I definitely do not tack .Bool onto the end
> > > of my `if` statements.
> >=20
> > Uh. That's exactly what you're doing. You do *not* need the .Bool
> > there at the end. The "not" makes Raku convert whatever is there
> > to a boolean, so the .Bool is implicit. And if you were to check
> > the other way, if you had "if $foo.IO.d { ... }", then the "if"
> > makes Raku convert whatever is there to a boolean, so the .Bool is
> > implicit. You do not need to put the .Bool in an "if" or a "while"
> > statement.
> >=20
> > G'luck,
> > Peter
> >=20
>=20
> Hi Peter,
>=20
> Brad asked me the same thing on another thread.  This is what I
> told him:
>=20
> Hi Brad,
>=20
> I do this because it keeps me out of trouble.
>=20
> I want back a yes or no answer, not True or Fail
> (X::IO::DoesNotExist).
>=20
> And I never remember which IO.<some_letter> will return
> a True or Fail or which functions (`if` does) will
> convert X::IO::DoesNotExist to a False for me.

OK, so I promise to the group that this is my last message on this
particular topic :)

Todd, you won't have to remember anything if you *only* use .IO.d and
=2EIO.e and all the rest the way the rest of the world uses them: *only*
in conditional statements. Your examples could have been written as:

    raku -e "say 'yes' if 'h:/'.IO.d"

=2E..and you would not have to remember anything except that .IO.d, .e,
=2Ef, and the rest of these predicates only need to be used in
conditionals. This covers 'if', 'while', and it also covers stuff like
"my $final-decision =3D $path.IO.d and $path.IO.w", since this is also
using the predicates in a sort of a conditional statement. Basically,
in any *real-world* situation where you'd want to use them, you don't
need the explicit conversion to boolean.

Hope that helps.

G'luck,
Peter

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

--UugvWAfsgieZRqgk
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEELuenpRf8EkzxFcNUZR7vsCUn3xMFAl7BmOYACgkQZR7vsCUn
3xOSJBAAvzsq85CTnng1U6WFbsCh9E4mz1uYKL8lnTk6YQNzoQD5IDmJQCCKyIbU
1Xn1l/w3SY7JSiuk6+Udc5uAIZa3t0SXLEYeh3VqMyyZXhH5JVzzpclc4M5wiJTE
+JHd1pIDPLC6PtjSEu9qoCtCwkCZtBamrN34/w9HOGAqwI1U1bvMdQseFVxn3Gl1
9UQGXRQADWJ/4zscZmV/LBxb+4DoDfMZ2jItXRSPTnDdBgUeEY5GVgmLZdHL32Di
4bCHTp9mPQE8FHxdxawN0GUWtzkxGASsxTI27RwtuAkyh6uF0PKrug2u1EvFAhiq
3MbLlq4zBalAvYh9iCfZrIzc+raFlLJcpozjZQv1bXcnn8ZZYZwp4p3NWkH/KK2u
lfG4Yl4RcnRU5ESDq4qE9m4UzmsYN1iv1YjiayYS/2ZqRIzOYlvHUKoRX05ILRh2
auvqAzdj4BCL00dKcGKChEKwv0CxL4FxX5HSgl12VFBDMuUL+GGgewxCPl5418IM
d/A9zIos+8kMV/AM+pCmnKQSTSoD+dBjfMHQn9AqhFGH09YJ9Lp41UmIyiCpc2jr
c6tGBdmYA95MHXQYzEaKInq1nAHIKsA8DpKG4ljZcHscVTMuAW8OqNlzZGk8mxnL
lp4E9SlTuQj0LR17gtVHPerhftJYoBGpl9bSl9foSPg5Y+TzUmI=
=GJf5
-----END PGP SIGNATURE-----

--UugvWAfsgieZRqgk--
0
roam
5/17/2020 8:04:59 PM
On 2020-05-17 13:04, Peter Pentchev wrote:
> On Sun, May 17, 2020 at 12:12:51PM -0700, ToddAndMargo via perl6-users wrote:
>> On 2020-05-17 03:36, Peter Pentchev wrote:
>>> On Sun, May 17, 2020 at 03:01:34AM -0700, ToddAndMargo via perl6-users wrote:
>>>> On 2020-05-17 02:30, Peter Pentchev wrote:
>>>>> You said that you would tack Bool at the end in "if" statements, too.
>>>>
>>>> Hi Peter,
>>>>
>>>> No wonder.  I do not remember saying that, but I could
>>>> have.  My `if` statements look like:
>>>>
>>>>      if not  "%Options<Path>".IO.d.Bool  {
>>>>         say "Creating %Options<Path>";
>>>>         mkdir( %Options<Path>", 0o777 );
>>>>      }
>>>>
>>>> I definitely do not tack .Bool onto the end
>>>> of my `if` statements.
>>>
>>> Uh. That's exactly what you're doing. You do *not* need the .Bool
>>> there at the end. The "not" makes Raku convert whatever is there
>>> to a boolean, so the .Bool is implicit. And if you were to check
>>> the other way, if you had "if $foo.IO.d { ... }", then the "if"
>>> makes Raku convert whatever is there to a boolean, so the .Bool is
>>> implicit. You do not need to put the .Bool in an "if" or a "while"
>>> statement.
>>>
>>> G'luck,
>>> Peter
>>>
>>
>> Hi Peter,
>>
>> Brad asked me the same thing on another thread.  This is what I
>> told him:
>>
>> Hi Brad,
>>
>> I do this because it keeps me out of trouble.
>>
>> I want back a yes or no answer, not True or Fail
>> (X::IO::DoesNotExist).
>>
>> And I never remember which IO.<some_letter> will return
>> a True or Fail or which functions (`if` does) will
>> convert X::IO::DoesNotExist to a False for me.
> 
> OK, so I promise to the group that this is my last message on this
> particular topic :)
> 
> Todd, you won't have to remember anything if you *only* use .IO.d and
> .IO.e and all the rest the way the rest of the world uses them: *only*
> in conditional statements. Your examples could have been written as:
> 
>      raku -e "say 'yes' if 'h:/'.IO.d"
> 
> ...and you would not have to remember anything except that .IO.d, .e,
> .f, and the rest of these predicates only need to be used in
> conditionals. This covers 'if', 'while', and it also covers stuff like
> "my $final-decision = $path.IO.d and $path.IO.w", since this is also
> using the predicates in a sort of a conditional statement. Basically,
> in any *real-world* situation where you'd want to use them, you don't
> need the explicit conversion to boolean.
> 
> Hope that helps.
> 
> G'luck,
> Peter
> 

Hi Peter,

Very true.

Although

    "say 'yes' if 'h:/'.IO.d"

is obscure to me and

    "say 'h:/'.IO.d.Bool"

is very easy for me to understand.

And since I am the one who is going to have to
maintain this code in perpetuity, maintainability
comes before everything else.  EVEN IF I have to
tell Raku to do something explicitly that it will
do for me on the fly.  It is all about me being
able to go into the code 5 days or 5 years
from now and being able to figure out what I did.

I had to convert a Perl 5 sub over and oh my goodness
the hoops I had to jump thought in Perl 5 that and
so very simplified in Raku.

Perl 5 does have the bad reputation of being a write
only language. (It is, only if you let it be.)

I likes Perl 5.  I ADORE Perl 6

-T

p.s. you are a wonderful teacher.  Do you have a
teaching background?
0
perl6
5/17/2020 9:43:01 PM
On 2020-05-17 14:43, ToddAndMargo via perl6-users wrote:
> Although
>=20
>  =C2=A0=C2=A0=C2=A0"say=C2=A0'yes'=C2=A0if=C2=A0'h:/'.IO.d"
>=20
> is=C2=A0obscure=C2=A0to=C2=A0me=C2=A0and
>=20
>  =C2=A0=C2=A0=C2=A0"say=C2=A0'h:/'.IO.d.Bool"
>=20
> is=C2=A0very=C2=A0easy=C2=A0for=C2=A0me=C2=A0to=C2=A0understand.


Hi Peter,

I think it would help if you knew how my
mind worked.

`if` to me is a Boolean function.  If this
expressions is true, do this, if not, do
something else.

This is what happens to me when I see expressions
like

     "say 'yes' if 'h:/'.IO.d"

if the expression (h:/.IO.d) is true, then
say the result of the expression test, not the
result from the expression.  I have to figure
out what the results from the expression are
and why it is passing or failing the test.

Two steps in my mind.  Not that I can't figure
things like this out, I just don't like the effort,
when it can be avoided.  The way I look at it, the
time it takes me to write five extra letters (.Bool)
will save me ten times that amount of time trying to
figure out what I did 5 days or 5 years from now.
Dr. Demming (Quality circles, Kaisen, etc.) makes
a very strong point of this

And `if` can actually be very helpful at times:
    if  $x ~~ s/ "abc" /def/ {...;}
will tell you if the regex actually found "abc".
This I adore because I know is a test.  Not
in the least bit obscure.

=2Ed is suppose to return a Boolen, but does not.
Some functions will convert the junk for you on
the fly.  Raku is very friendly this way.  Five extra
letters and I do not have to wonder who does what
to whom.

Yes, I am a bit weird.

Thank you for all the wonderful explanations!  Very
much appreciated.

-T
0
perl6
5/17/2020 10:10:25 PM
--00000000000035e3e805a5e3c122
Content-Type: text/plain; charset="UTF-8"

So tack a .Bool at the end.
You are coercing a bool to a bool by doing so and hopefully the optimizer
is smart enough for people who like to be redundant.

;)

On Sun, May 17, 2020 at 6:10 PM ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:

> On 2020-05-17 14:43, ToddAndMargo via perl6-users wrote:
> > Although
> >
> >     "say 'yes' if 'h:/'.IO.d"
> >
> > is obscure to me and
> >
> >     "say 'h:/'.IO.d.Bool"
> >
> > is very easy for me to understand.
>
>
> Hi Peter,
>
> I think it would help if you knew how my
> mind worked.
>
> `if` to me is a Boolean function.  If this
> expressions is true, do this, if not, do
> something else.
>
> This is what happens to me when I see expressions
> like
>
>      "say 'yes' if 'h:/'.IO.d"
>
> if the expression (h:/.IO.d) is true, then
> say the result of the expression test, not the
> result from the expression.  I have to figure
> out what the results from the expression are
> and why it is passing or failing the test.
>
> Two steps in my mind.  Not that I can't figure
> things like this out, I just don't like the effort,
> when it can be avoided.  The way I look at it, the
> time it takes me to write five extra letters (.Bool)
> will save me ten times that amount of time trying to
> figure out what I did 5 days or 5 years from now.
> Dr. Demming (Quality circles, Kaisen, etc.) makes
> a very strong point of this
>
> And `if` can actually be very helpful at times:
>     if  $x ~~ s/ "abc" /def/ {...;}
> will tell you if the regex actually found "abc".
> This I adore because I know is a test.  Not
> in the least bit obscure.
>
> .d is suppose to return a Boolen, but does not.
> Some functions will convert the junk for you on
> the fly.  Raku is very friendly this way.  Five extra
> letters and I do not have to wonder who does what
> to whom.
>
> Yes, I am a bit weird.
>
> Thank you for all the wonderful explanations!  Very
> much appreciated.
>
> -T
>


-- 
__________________

:(){ :|:& };:

--00000000000035e3e805a5e3c122
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>So tack a .Bool at the end.</div><div>You are coercin=
g a bool to a bool by doing so and hopefully the optimizer is smart enough =
for people who like to be redundant.<br></div><div><br></div><div>;)<br></d=
iv></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_att=
r">On Sun, May 17, 2020 at 6:10 PM ToddAndMargo via perl6-users &lt;<a href=
=3D"mailto:perl6-users@perl.org">perl6-users@perl.org</a>&gt; wrote:<br></d=
iv><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bord=
er-left:1px solid rgb(204,204,204);padding-left:1ex">On 2020-05-17 14:43, T=
oddAndMargo via perl6-users wrote:<br>
&gt; Although<br>
&gt; <br>
&gt;=C2=A0 =C2=A0=C2=A0=C2=A0&quot;say=C2=A0&#39;yes&#39;=C2=A0if=C2=A0&#39=
;h:/&#39;.IO.d&quot;<br>
&gt; <br>
&gt; is=C2=A0obscure=C2=A0to=C2=A0me=C2=A0and<br>
&gt; <br>
&gt;=C2=A0 =C2=A0=C2=A0=C2=A0&quot;say=C2=A0&#39;h:/&#39;.IO.d.Bool&quot;<b=
r>
&gt; <br>
&gt; is=C2=A0very=C2=A0easy=C2=A0for=C2=A0me=C2=A0to=C2=A0understand.<br>
<br>
<br>
Hi Peter,<br>
<br>
I think it would help if you knew how my<br>
mind worked.<br>
<br>
`if` to me is a Boolean function.=C2=A0 If this<br>
expressions is true, do this, if not, do<br>
something else.<br>
<br>
This is what happens to me when I see expressions<br>
like<br>
<br>
=C2=A0 =C2=A0 =C2=A0&quot;say &#39;yes&#39; if &#39;h:/&#39;.IO.d&quot;<br>
<br>
if the expression (h:/.IO.d) is true, then<br>
say the result of the expression test, not the<br>
result from the expression.=C2=A0 I have to figure<br>
out what the results from the expression are<br>
and why it is passing or failing the test.<br>
<br>
Two steps in my mind.=C2=A0 Not that I can&#39;t figure<br>
things like this out, I just don&#39;t like the effort,<br>
when it can be avoided.=C2=A0 The way I look at it, the<br>
time it takes me to write five extra letters (.Bool)<br>
will save me ten times that amount of time trying to<br>
figure out what I did 5 days or 5 years from now.<br>
Dr. Demming (Quality circles, Kaisen, etc.) makes<br>
a very strong point of this<br>
<br>
And `if` can actually be very helpful at times:<br>
=C2=A0 =C2=A0 if=C2=A0 $x ~~ s/ &quot;abc&quot; /def/ {...;}<br>
will tell you if the regex actually found &quot;abc&quot;.<br>
This I adore because I know is a test.=C2=A0 Not<br>
in the least bit obscure.<br>
<br>
..d is suppose to return a Boolen, but does not.<br>
Some functions will convert the junk for you on<br>
the fly.=C2=A0 Raku is very friendly this way.=C2=A0 Five extra<br>
letters and I do not have to wonder who does what<br>
to whom.<br>
<br>
Yes, I am a bit weird.<br>
<br>
Thank you for all the wonderful explanations!=C2=A0 Very<br>
much appreciated.<br>
<br>
-T<br>
</blockquote></div><br clear=3D"all"><br>-- <br><div dir=3D"ltr" class=3D"g=
mail_signature">__________________<br><br>:(){ :|:&amp; };:</div>

--00000000000035e3e805a5e3c122--
0
pprocacci
5/18/2020 3:28:10 AM
On 2020-05-17 20:28, Paul Procacci wrote:
> So tack a .Bool at the end.
> You are coercing a bool to a bool by doing so and hopefully the 
> optimizer is smart enough for people who like to be redundant.
> 
> ;)

Hi Paul,

Especially when I can never remember when IO.someletter
will return a full True or False Boolean and when it
will return a True or a useless text message.

The optimizer should have a lot of fun with me!  Works
darned well too!

-T
0
perl6
5/18/2020 4:19:06 AM
On 2020-05-17 21:19, ToddAndMargo via perl6-users wrote:
> On 2020-05-17 20:28, Paul Procacci wrote:
>> So tack a .Bool at the end.
>> You are coercing a bool to a bool by doing so and hopefully the=20
>> optimizer is smart enough for people who like to be redundant.
>>
>> ;)
>=20
> Hi Paul,
>=20
> Especially when I can never remember when IO.someletter
> will return a full True or False Boolean and when it
> will return a True or a useless text message.
>=20
> The optimizer should have a lot of fun with me!=C2=A0 Works
> darned well too!
>=20
> -T

Speaking of optimizer, it would be interesting to see
if my coercing a half a Bool and a useless text message
to a True of False when analyzed takes  more of less
optimizing than giving it a straight Boolean to start with.

But now I are getting at some really deep trivia
0
perl6
5/18/2020 4:24:59 AM
--0000000000000c075305a5e4e0f5
Content-Type: text/plain; charset="UTF-8"

You can check this yourself by looking at the QAST nodes after the static
analyzer has had its fill:

# diff -u <(perl6 --target=optimize -e '"test".IO.e') <(perl6
--target=optimize -e '"test".IO.e.Bool')

On Mon, May 18, 2020 at 12:25 AM ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:

> On 2020-05-17 21:19, ToddAndMargo via perl6-users wrote:
> > On 2020-05-17 20:28, Paul Procacci wrote:
> >> So tack a .Bool at the end.
> >> You are coercing a bool to a bool by doing so and hopefully the
> >> optimizer is smart enough for people who like to be redundant.
> >>
> >> ;)
> >
> > Hi Paul,
> >
> > Especially when I can never remember when IO.someletter
> > will return a full True or False Boolean and when it
> > will return a True or a useless text message.
> >
> > The optimizer should have a lot of fun with me!  Works
> > darned well too!
> >
> > -T
>
> Speaking of optimizer, it would be interesting to see
> if my coercing a half a Bool and a useless text message
> to a True of False when analyzed takes  more of less
> optimizing than giving it a straight Boolean to start with.
>
> But now I are getting at some really deep trivia
>


-- 
__________________

:(){ :|:& };:

--0000000000000c075305a5e4e0f5
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>You can check this yourself by looking at the QAST no=
des after the static analyzer has had its fill:</div><div><br></div><div># =
diff -u &lt;(perl6 --target=3Doptimize -e &#39;&quot;test&quot;.IO.e&#39;) =
&lt;(perl6 --target=3Doptimize -e &#39;&quot;test&quot;.IO.e.Bool&#39;)</di=
v></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr=
">On Mon, May 18, 2020 at 12:25 AM ToddAndMargo via perl6-users &lt;<a href=
=3D"mailto:perl6-users@perl.org">perl6-users@perl.org</a>&gt; wrote:<br></d=
iv><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bord=
er-left:1px solid rgb(204,204,204);padding-left:1ex">On 2020-05-17 21:19, T=
oddAndMargo via perl6-users wrote:<br>
&gt; On 2020-05-17 20:28, Paul Procacci wrote:<br>
&gt;&gt; So tack a .Bool at the end.<br>
&gt;&gt; You are coercing a bool to a bool by doing so and hopefully the <b=
r>
&gt;&gt; optimizer is smart enough for people who like to be redundant.<br>
&gt;&gt;<br>
&gt;&gt; ;)<br>
&gt; <br>
&gt; Hi Paul,<br>
&gt; <br>
&gt; Especially when I can never remember when IO.someletter<br>
&gt; will return a full True or False Boolean and when it<br>
&gt; will return a True or a useless text message.<br>
&gt; <br>
&gt; The optimizer should have a lot of fun with me!=C2=A0 Works<br>
&gt; darned well too!<br>
&gt; <br>
&gt; -T<br>
<br>
Speaking of optimizer, it would be interesting to see<br>
if my coercing a half a Bool and a useless text message<br>
to a True of False when analyzed takes=C2=A0 more of less<br>
optimizing than giving it a straight Boolean to start with.<br>
<br>
But now I are getting at some really deep trivia<br>
</blockquote></div><br clear=3D"all"><br>-- <br><div dir=3D"ltr" class=3D"g=
mail_signature">__________________<br><br>:(){ :|:&amp; };:</div>

--0000000000000c075305a5e4e0f5--
0
pprocacci
5/18/2020 4:48:22 AM
On 2020-05-17 21:48, Paul Procacci wrote:
> You can check this yourself by looking at the QAST nodes after the=20
> static analyzer has had its fill:
>=20
> # diff -u <(perl6 --target=3Doptimize -e '"test".IO.e') <(perl6=20
> --target=3Doptimize -e '"test".IO.e.Bool')

Huh.  Not sure what I am looking at


$ diff -u <(perl6 --target=3Doptimize -e 'say if "test".IO.d') <(perl6=20
--target=3Doptimize -e 'say "test".IO.d.Bool')
=3D=3D=3DSORRY!=3D=3D=3D Error while compiling -e
Unsupported use of bare "say"; in Raku please use .say if you meant to=20
call it as a method on $_, or use an explicit invocant or argument, or=20
use &say to refer to the function as a noun
at -e:1
------> say=E2=8F=8F if "test".IO.d
--- /dev/fd/63	2020-05-17 22:01:37.947790677 -0700
+++ /dev/fd/62	2020-05-17 22:01:37.948790659 -0700
@@ -0,0 +1,98 @@
+- QAST::CompUnit  :W<?> :UNIT<?> :CAN_LOWER_TOPIC<?>
+  [pre_deserialize]
+    - QAST::Stmt
+      - QAST::Stmt
+        - QAST::Op(loadbytecode)
+          - QAST::VM
+            [moar]
+              - QAST::SVal(ModuleLoader.moarvm)
+            [jvm]
+              - QAST::SVal(ModuleLoader.class)
+            [js]
+              - QAST::SVal(ModuleLoader)
+        - QAST::Op(callmethod load_module)
+          - QAST::Op(gethllsym)
+            - QAST::SVal(nqp)
+            - QAST::SVal(ModuleLoader)
+          - QAST::SVal(Perl6::ModuleLoader)
+      - QAST::Op(forceouterctx)
+        - QAST::BVal(2)
+        - QAST::Op(callmethod load_setting)
+          - QAST::Op(getcurhllsym)
+            - QAST::SVal(ModuleLoader)
+          - QAST::SVal(CORE.d)
+  [post_deserialize]
+    - QAST::Stmts
+      - QAST::Op(bind)
+        - QAST::Var(attribute $!do)
+          - QAST::WVal(Block)
+          - QAST::WVal(Code)
+        - QAST::BVal(1)
+    - QAST::Op(bindcurhllsym)
+      - QAST::SVal(GLOBAL)
+      - QAST::WVal(GLOBAL)
+  [load]
+    - QAST::Op(call)
+      - QAST::BVal(2)
+  [children]
+    - QAST::Block(:cuid(2))  :in_stmt_mod<?> say \"test\".IO.d.Bool
+    =E2=94=82 - QAST::Var(local __args__ :decl(param))
+    =E2=94=82 - QAST::Stmts  say \"test\".IO.d.Bool
+    =E2=94=82 - QAST::Op(call)
+    =E2=94=82   - QAST::Block(:cuid(1) :blocktype(declaration_static))=20
:outer<?> :in_stmt_mod<?> :code_object<?> :IN_DECL<mainline>
+    =E2=94=82   =E2=94=82 - QAST::Stmts  say \"test\".IO.d.Bool
+    =E2=94=82   =E2=94=82   - QAST::Var(lexical $=C2=A2 :decl(contvar))
+    =E2=94=82   =E2=94=82   - QAST::Var(lexical $! :decl(contvar))
+    =E2=94=82   =E2=94=82   - QAST::Var(lexical $/ :decl(contvar))
+    =E2=94=82   =E2=94=82   - QAST::Op(null)
+    =E2=94=82   =E2=94=82   - QAST::Var(lexical GLOBALish :decl(static))=

+    =E2=94=82   =E2=94=82   - QAST::Var(lexical EXPORT :decl(static))
+    =E2=94=82   =E2=94=82   - QAST::Var(lexical $?PACKAGE :decl(static))=

+    =E2=94=82   =E2=94=82   - QAST::Var(lexical ::?PACKAGE :decl(static)=
)
+    =E2=94=82   =E2=94=82   - QAST::Var(lexical $=3Dfinish :decl(static)=
)
+    =E2=94=82   =E2=94=82   - QAST::Var(lexical $=3Dpod :decl(static))
+    =E2=94=82   =E2=94=82     [value]
+    =E2=94=82   =E2=94=82       -
+    =E2=94=82   =E2=94=82   - QAST::Var(lexical !UNIT_MARKER :decl(stati=
c))
+    =E2=94=82   =E2=94=82 - QAST::Stmts
+    =E2=94=82   =E2=94=82   - QAST::Op(bind)
+    =E2=94=82   =E2=94=82     - QAST::Var(local ctxsave :decl(var))
+    =E2=94=82   =E2=94=82     - QAST::Var(contextual $*CTXSAVE)
+    =E2=94=82   =E2=94=82   - QAST::Op(unless)
+    =E2=94=82   =E2=94=82     - QAST::Op(isnull)
+    =E2=94=82   =E2=94=82       - QAST::Var(local ctxsave)
+    =E2=94=82   =E2=94=82     - QAST::Op(if)
+    =E2=94=82   =E2=94=82       - QAST::Op(can)
+    =E2=94=82   =E2=94=82         - QAST::Var(local ctxsave)
+    =E2=94=82   =E2=94=82         - QAST::SVal(ctxsave)
+    =E2=94=82   =E2=94=82       - QAST::Op(callmethod ctxsave)
+    =E2=94=82   =E2=94=82         - QAST::Var(local ctxsave)
+    =E2=94=82   =E2=94=82 - QAST::Stmts
+    =E2=94=82   =E2=94=82   - QAST::WVal(Array)
+    =E2=94=82   =E2=94=82   - QAST::Stmt <sunk final> say \"test\".IO.d.=
Bool
+    =E2=94=82   =E2=94=82     - QAST::Want <sunk>
+    =E2=94=82   =E2=94=82       - QAST::Op(callstatic &say) <sunk> :stat=
ement_id<1> say=20
\"test\".IO.d.Bool
+    =E2=94=82   =E2=94=82         - QAST::Op(hllize) <wanted>
+    =E2=94=82   =E2=94=82           - QAST::Op(callmethod Bool)  Bool
+    =E2=94=82   =E2=94=82             - QAST::Op(hllize) <wanted>
+    =E2=94=82   =E2=94=82               - QAST::Op(callmethod d)  d
+    =E2=94=82   =E2=94=82                 - QAST::Op(hllize) <wanted>
+    =E2=94=82   =E2=94=82                   - QAST::Op(callmethod IO)  I=
O
+    =E2=94=82   =E2=94=82                     - QAST::Want <wanted> test=

+    =E2=94=82   =E2=94=82                       - QAST::WVal(Str)
+    =E2=94=82   =E2=94=82                       - Ss
+    =E2=94=82   =E2=94=82                       - QAST::SVal(test)
+    =E2=94=82   =E2=94=82       - v
+    =E2=94=82   =E2=94=82       - QAST::Op(p6sink)
+    =E2=94=82   =E2=94=82         - QAST::Op(callstatic &say) <sunk> :st=
atement_id<1>=20
say \"test\".IO.d.Bool
+    =E2=94=82   =E2=94=82           - QAST::Op(hllize) <wanted>
+    =E2=94=82   =E2=94=82             - QAST::Op(callmethod Bool)  Bool
+    =E2=94=82   =E2=94=82               - QAST::Op(hllize) <wanted>
+    =E2=94=82   =E2=94=82                 - QAST::Op(callmethod d)  d
+    =E2=94=82   =E2=94=82                   - QAST::Op(hllize) <wanted>
+    =E2=94=82   =E2=94=82                     - QAST::Op(callmethod IO) =
 IO
+    =E2=94=82   =E2=94=82                       - QAST::Want <wanted> te=
st
+    =E2=94=82   =E2=94=82                         - QAST::WVal(Str)
+    =E2=94=82   =E2=94=82                         - Ss
+    =E2=94=82   =E2=94=82                         - QAST::SVal(test)
+    =E2=94=82   =E2=94=82   - QAST::WVal(Nil)
0
perl6
5/18/2020 5:03:19 AM
--000000000000cdddee05a5e56eed
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Don't 'say' anything.  Just let the optimizer spit out the QAST that you
are interested in looking at.
The following spits out a diff after optimization:

# diff -u <(perl6 --target=3Doptimize -e '"test".IO.e') <(perl6
--target=3Doptimize -e '"test".IO.e.Bool')

>> Huh.  Not sure what I am looking at

You aren't specific.  Is it the error message you received because you used
'say' improperly or is it the QAST?
- How to use 'say' is in the documentation.
- A QAST is pretty close to an AST and I'd start there on wikipedia or
something.

On Mon, May 18, 2020 at 1:03 AM ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:

> On 2020-05-17 21:48, Paul Procacci wrote:
> > You can check this yourself by looking at the QAST nodes after the
> > static analyzer has had its fill:
> >
> > # diff -u <(perl6 --target=3Doptimize -e '"test".IO.e') <(perl6
> > --target=3Doptimize -e '"test".IO.e.Bool')
>
> Huh.  Not sure what I am looking at
>
>
> $ diff -u <(perl6 --target=3Doptimize -e 'say if "test".IO.d') <(perl6
> --target=3Doptimize -e 'say "test".IO.d.Bool')
> =3D=3D=3DSORRY!=3D=3D=3D Error while compiling -e
> Unsupported use of bare "say"; in Raku please use .say if you meant to
> call it as a method on $_, or use an explicit invocant or argument, or
> use &say to refer to the function as a noun
> at -e:1
> ------> say=E2=8F=8F if "test".IO.d
> --- /dev/fd/63  2020-05-17 22:01:37.947790677 -0700
> +++ /dev/fd/62  2020-05-17 22:01:37.948790659 -0700
> @@ -0,0 +1,98 @@
> +- QAST::CompUnit  :W<?> :UNIT<?> :CAN_LOWER_TOPIC<?>
> +  [pre_deserialize]
> +    - QAST::Stmt
> +      - QAST::Stmt
> +        - QAST::Op(loadbytecode)
> +          - QAST::VM
> +            [moar]
> +              - QAST::SVal(ModuleLoader.moarvm)
> +            [jvm]
> +              - QAST::SVal(ModuleLoader.class)
> +            [js]
> +              - QAST::SVal(ModuleLoader)
> +        - QAST::Op(callmethod load_module)
> +          - QAST::Op(gethllsym)
> +            - QAST::SVal(nqp)
> +            - QAST::SVal(ModuleLoader)
> +          - QAST::SVal(Perl6::ModuleLoader)
> +      - QAST::Op(forceouterctx)
> +        - QAST::BVal(2)
> +        - QAST::Op(callmethod load_setting)
> +          - QAST::Op(getcurhllsym)
> +            - QAST::SVal(ModuleLoader)
> +          - QAST::SVal(CORE.d)
> +  [post_deserialize]
> +    - QAST::Stmts
> +      - QAST::Op(bind)
> +        - QAST::Var(attribute $!do)
> +          - QAST::WVal(Block)
> +          - QAST::WVal(Code)
> +        - QAST::BVal(1)
> +    - QAST::Op(bindcurhllsym)
> +      - QAST::SVal(GLOBAL)
> +      - QAST::WVal(GLOBAL)
> +  [load]
> +    - QAST::Op(call)
> +      - QAST::BVal(2)
> +  [children]
> +    - QAST::Block(:cuid(2))  :in_stmt_mod<?> say \"test\".IO.d.Bool
> +    =E2=94=82 - QAST::Var(local __args__ :decl(param))
> +    =E2=94=82 - QAST::Stmts  say \"test\".IO.d.Bool
> +    =E2=94=82 - QAST::Op(call)
> +    =E2=94=82   - QAST::Block(:cuid(1) :blocktype(declaration_static))
> :outer<?> :in_stmt_mod<?> :code_object<?> :IN_DECL<mainline>
> +    =E2=94=82   =E2=94=82 - QAST::Stmts  say \"test\".IO.d.Bool
> +    =E2=94=82   =E2=94=82   - QAST::Var(lexical $=C2=A2 :decl(contvar))
> +    =E2=94=82   =E2=94=82   - QAST::Var(lexical $! :decl(contvar))
> +    =E2=94=82   =E2=94=82   - QAST::Var(lexical $/ :decl(contvar))
> +    =E2=94=82   =E2=94=82   - QAST::Op(null)
> +    =E2=94=82   =E2=94=82   - QAST::Var(lexical GLOBALish :decl(static))
> +    =E2=94=82   =E2=94=82   - QAST::Var(lexical EXPORT :decl(static))
> +    =E2=94=82   =E2=94=82   - QAST::Var(lexical $?PACKAGE :decl(static))
> +    =E2=94=82   =E2=94=82   - QAST::Var(lexical ::?PACKAGE :decl(static)=
)
> +    =E2=94=82   =E2=94=82   - QAST::Var(lexical $=3Dfinish :decl(static)=
)
> +    =E2=94=82   =E2=94=82   - QAST::Var(lexical $=3Dpod :decl(static))
> +    =E2=94=82   =E2=94=82     [value]
> +    =E2=94=82   =E2=94=82       -
> +    =E2=94=82   =E2=94=82   - QAST::Var(lexical !UNIT_MARKER :decl(stati=
c))
> +    =E2=94=82   =E2=94=82 - QAST::Stmts
> +    =E2=94=82   =E2=94=82   - QAST::Op(bind)
> +    =E2=94=82   =E2=94=82     - QAST::Var(local ctxsave :decl(var))
> +    =E2=94=82   =E2=94=82     - QAST::Var(contextual $*CTXSAVE)
> +    =E2=94=82   =E2=94=82   - QAST::Op(unless)
> +    =E2=94=82   =E2=94=82     - QAST::Op(isnull)
> +    =E2=94=82   =E2=94=82       - QAST::Var(local ctxsave)
> +    =E2=94=82   =E2=94=82     - QAST::Op(if)
> +    =E2=94=82   =E2=94=82       - QAST::Op(can)
> +    =E2=94=82   =E2=94=82         - QAST::Var(local ctxsave)
> +    =E2=94=82   =E2=94=82         - QAST::SVal(ctxsave)
> +    =E2=94=82   =E2=94=82       - QAST::Op(callmethod ctxsave)
> +    =E2=94=82   =E2=94=82         - QAST::Var(local ctxsave)
> +    =E2=94=82   =E2=94=82 - QAST::Stmts
> +    =E2=94=82   =E2=94=82   - QAST::WVal(Array)
> +    =E2=94=82   =E2=94=82   - QAST::Stmt <sunk final> say \"test\".IO.d.=
Bool
> +    =E2=94=82   =E2=94=82     - QAST::Want <sunk>
> +    =E2=94=82   =E2=94=82       - QAST::Op(callstatic &say) <sunk> :stat=
ement_id<1> say
> \"test\".IO.d.Bool
> +    =E2=94=82   =E2=94=82         - QAST::Op(hllize) <wanted>
> +    =E2=94=82   =E2=94=82           - QAST::Op(callmethod Bool)  Bool
> +    =E2=94=82   =E2=94=82             - QAST::Op(hllize) <wanted>
> +    =E2=94=82   =E2=94=82               - QAST::Op(callmethod d)  d
> +    =E2=94=82   =E2=94=82                 - QAST::Op(hllize) <wanted>
> +    =E2=94=82   =E2=94=82                   - QAST::Op(callmethod IO)  I=
O
> +    =E2=94=82   =E2=94=82                     - QAST::Want <wanted> test
> +    =E2=94=82   =E2=94=82                       - QAST::WVal(Str)
> +    =E2=94=82   =E2=94=82                       - Ss
> +    =E2=94=82   =E2=94=82                       - QAST::SVal(test)
> +    =E2=94=82   =E2=94=82       - v
> +    =E2=94=82   =E2=94=82       - QAST::Op(p6sink)
> +    =E2=94=82   =E2=94=82         - QAST::Op(callstatic &say) <sunk> :st=
atement_id<1>
> say \"test\".IO.d.Bool
> +    =E2=94=82   =E2=94=82           - QAST::Op(hllize) <wanted>
> +    =E2=94=82   =E2=94=82             - QAST::Op(callmethod Bool)  Bool
> +    =E2=94=82   =E2=94=82               - QAST::Op(hllize) <wanted>
> +    =E2=94=82   =E2=94=82                 - QAST::Op(callmethod d)  d
> +    =E2=94=82   =E2=94=82                   - QAST::Op(hllize) <wanted>
> +    =E2=94=82   =E2=94=82                     - QAST::Op(callmethod IO) =
 IO
> +    =E2=94=82   =E2=94=82                       - QAST::Want <wanted> te=
st
> +    =E2=94=82   =E2=94=82                         - QAST::WVal(Str)
> +    =E2=94=82   =E2=94=82                         - Ss
> +    =E2=94=82   =E2=94=82                         - QAST::SVal(test)
> +    =E2=94=82   =E2=94=82   - QAST::WVal(Nil)
>


--=20
__________________

:(){ :|:& };:

--000000000000cdddee05a5e56eed
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: base64

PGRpdiBkaXI9Imx0ciI+RG9uJiMzOTt0ICYjMzk7c2F5JiMzOTsgYW55dGhpbmcuwqAgSnVzdCBs
ZXQgdGhlIG9wdGltaXplciBzcGl0IG91dCB0aGUgUUFTVCB0aGF0IHlvdSBhcmUgaW50ZXJlc3Rl
ZCBpbiBsb29raW5nIGF0Ljxicj48ZGl2PjxkaXY+VGhlIGZvbGxvd2luZyBzcGl0cyBvdXQgYSBk
aWZmIGFmdGVyIG9wdGltaXphdGlvbjo8YnI+PGJyPg0KIyBkaWZmIC11ICZsdDsocGVybDYgLS10
YXJnZXQ9b3B0aW1pemUgLWUgJiMzOTsmcXVvdDt0ZXN0JnF1b3Q7LklPLmUmIzM5OykgJmx0Oyhw
ZXJsNiAtLXRhcmdldD1vcHRpbWl6ZSAtZSAmIzM5OyZxdW90O3Rlc3QmcXVvdDsuSU8uZS5Cb29s
JiMzOTspIDxicj48L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PiZndDsmZ3Q7DQpIdWguwqAgTm90
IHN1cmUgd2hhdCBJIGFtIGxvb2tpbmcgYXQgPGJyPjwvZGl2PjxkaXY+PGJyPjwvZGl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IMKgIMKgIMKgIMKgIMKgIMKgLSBRQVNUOjpPcChjYWxs
bWV0aG9kIElPKcKgIElPPGJyPg0KK8KgIMKgIOKUgsKgIMKg4pSCwqAgwqAgwqAgwqAgwqAgwqAg
wqAgwqAgwqAgwqAgwqAgwqAtIFFBU1Q6OldhbnQgJmx0O3dhbnRlZCZndDsgdGVzdDxicj4NCivC
oCDCoCDilILCoCDCoOKUgsKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgLSBR
QVNUOjpXVmFsKFN0cik8YnI+DQorwqAgwqAg4pSCwqAgwqDilILCoCDCoCDCoCDCoCDCoCDCoCDC
oCDCoCDCoCDCoCDCoCDCoCDCoC0gU3M8YnI+DQorwqAgwqAg4pSCwqAgwqDilILCoCDCoCDCoCDC
oCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoC0gUUFTVDo6U1ZhbCh0ZXN0KTxicj4NCivCoCDC
oCDilILCoCDCoOKUgsKgIMKgLSBRQVNUOjpXVmFsKE5pbCk8YnI+DQo8L2Jsb2NrcXVvdGU+PC9k
aXY+PGJyIGNsZWFyPSJhbGwiPjxicj4tLSA8YnI+PGRpdiBkaXI9Imx0ciIgY2xhc3M9ImdtYWls
X3NpZ25hdHVyZSI+X19fX19fX19fX19fX19fX19fPGJyPjxicj46KCl7IDp8OiZhbXA7IH07Ojwv
ZGl2Pg0K
--000000000000cdddee05a5e56eed--
0
pprocacci
5/18/2020 5:28:17 AM
On 2020-05-17 22:28, Paul Procacci wrote:
> Don't 'say' anything.=C2=A0 Just let the optimizer spit out the QAST th=
at you=20
> are interested in looking at.
> The following spits out a diff after optimization:
>=20
> # diff -u <(perl6 --target=3Doptimize -e '"test".IO.e') <(perl6=20
> --target=3Doptimize -e '"test".IO.e.Bool')
>=20
>  >> Huh.=C2=A0 Not sure what I am looking at
>=20
> You aren't specific.=C2=A0 Is it the error message you received because=
 you=20
> used 'say' improperly or is it the QAST?
> - How to use 'say' is in the documentation.
> - A QAST is pretty close to an AST and I'd start there on wikipedia or =

> something.

I was looking for the difference between

'say if "test".IO.d',  and
'say "test".IO.d.Bool'

This is were 'if" has to unscramble a "True" or
"text message" return.

But, I have no idea what all that stuff is that comes
back anyway, so I think I will give up.

Thank you for all the help!

-T
0
perl6
5/18/2020 7:35:47 PM
--0000000000008cf46505a5f201d9
Content-Type: text/plain; charset="UTF-8"

On Mon, May 18, 2020 at 14:36 ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:

> On 2020-05-17 22:28, Paul Procacci wrote:

....

> 'say if "test".IO.d',  and
> 'say "test".IO.d.Bool'


Try:

'say so "test".IO.d'

--0000000000008cf46505a5f201d9
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div>On Mon, May 18, 2020 at 14:36 ToddAndMargo via perl6-users &lt;<a href=
=3D"mailto:perl6-users@perl.org">perl6-users@perl.org</a>&gt; wrote:<br></d=
iv><div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 2020-=
05-17 22:28, Paul Procacci wrote:</blockquote><div dir=3D"auto">...</div><b=
lockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px =
#ccc solid;padding-left:1ex">
&#39;say if &quot;test&quot;.IO.d&#39;,=C2=A0 and<br>
&#39;say &quot;test&quot;.IO.d.Bool&#39;</blockquote><div dir=3D"auto"><br>=
</div><div dir=3D"auto">Try:</div><div dir=3D"auto"><br></div><div dir=3D"a=
uto">&#39;say so &quot;test&quot;.IO.d&#39;</div><div dir=3D"auto"><br></di=
v></div></div>

--0000000000008cf46505a5f201d9--
0
tom
5/18/2020 8:28:19 PM
On 2020-05-18 13:28, Tom Browder wrote:
> On Mon, May 18, 2020 at 14:36 ToddAndMargo via perl6-users=20
> <perl6-users@perl.org <mailto:perl6-users@perl.org>> wrote:
>=20
>     On 2020-05-17 22:28, Paul Procacci wrote:
>=20
> ...
>=20
>     'say if "test".IO.d',=C2=A0 and
>     'say "test".IO.d.Bool'
>=20
>=20
> Try:
>=20
> 'say so "test".IO.d'
>=20

I have mo clue that this says



$ diff -u <(perl6 --target=3Doptimize -e 'so if "test".IO.d') <(perl6=20
--target=3Doptimize -e 'so "test".IO.d.Bool')
=3D=3D=3DSORRY!=3D=3D=3D Error while compiling -e
Undeclared routine:
     if used at line 1

WARNINGS for -e:
Useless use of "so " in expression "so \"test\".IO.d.Bool" in sink=20
context (line 1)
--- /dev/fd/63	2020-05-18 14:17:32.731286061 -0700
+++ /dev/fd/62	2020-05-18 14:17:32.732286043 -0700
@@ -0,0 +1,98 @@
+- QAST::CompUnit  :W<?> :UNIT<?> :CAN_LOWER_TOPIC<?>
+  [pre_deserialize]
+    - QAST::Stmt
+      - QAST::Stmt
+        - QAST::Op(loadbytecode)
+          - QAST::VM
+            [moar]
+              - QAST::SVal(ModuleLoader.moarvm)
+            [jvm]
+              - QAST::SVal(ModuleLoader.class)
+            [js]
+              - QAST::SVal(ModuleLoader)
+        - QAST::Op(callmethod load_module)
+          - QAST::Op(gethllsym)
+            - QAST::SVal(nqp)
+            - QAST::SVal(ModuleLoader)
+          - QAST::SVal(Perl6::ModuleLoader)
+      - QAST::Op(forceouterctx)
+        - QAST::BVal(2)
+        - QAST::Op(callmethod load_setting)
+          - QAST::Op(getcurhllsym)
+            - QAST::SVal(ModuleLoader)
+          - QAST::SVal(CORE.d)
+  [post_deserialize]
+    - QAST::Stmts
+      - QAST::Op(bind)
+        - QAST::Var(attribute $!do)
+          - QAST::WVal(Block)
+          - QAST::WVal(Code)
+        - QAST::BVal(1)
+    - QAST::Op(bindcurhllsym)
+      - QAST::SVal(GLOBAL)
+      - QAST::WVal(GLOBAL)
+  [load]
+    - QAST::Op(call)
+      - QAST::BVal(2)
+  [children]
+    - QAST::Block(:cuid(2))  :in_stmt_mod<?> so \"test\".IO.d.Bool
+    =E2=94=82 - QAST::Var(local __args__ :decl(param))
+    =E2=94=82 - QAST::Stmts  so \"test\".IO.d.Bool
+    =E2=94=82 - QAST::Op(call)
+    =E2=94=82   - QAST::Block(:cuid(1) :blocktype(declaration_static))=20
:outer<?> :in_stmt_mod<?> :code_object<?> :IN_DECL<mainline>
+    =E2=94=82   =E2=94=82 - QAST::Stmts  so \"test\".IO.d.Bool
+    =E2=94=82   =E2=94=82   - QAST::Var(lexical $=C2=A2 :decl(contvar))
+    =E2=94=82   =E2=94=82   - QAST::Var(lexical $! :decl(contvar))
+    =E2=94=82   =E2=94=82   - QAST::Var(lexical $/ :decl(contvar))
+    =E2=94=82   =E2=94=82   - QAST::Op(null)
+    =E2=94=82   =E2=94=82   - QAST::Var(lexical GLOBALish :decl(static))=

+    =E2=94=82   =E2=94=82   - QAST::Var(lexical EXPORT :decl(static))
+    =E2=94=82   =E2=94=82   - QAST::Var(lexical $?PACKAGE :decl(static))=

+    =E2=94=82   =E2=94=82   - QAST::Var(lexical ::?PACKAGE :decl(static)=
)
+    =E2=94=82   =E2=94=82   - QAST::Var(lexical $=3Dfinish :decl(static)=
)
+    =E2=94=82   =E2=94=82   - QAST::Var(lexical $=3Dpod :decl(static))
+    =E2=94=82   =E2=94=82     [value]
+    =E2=94=82   =E2=94=82       -
+    =E2=94=82   =E2=94=82   - QAST::Var(lexical !UNIT_MARKER :decl(stati=
c))
+    =E2=94=82   =E2=94=82 - QAST::Stmts
+    =E2=94=82   =E2=94=82   - QAST::Op(bind)
+    =E2=94=82   =E2=94=82     - QAST::Var(local ctxsave :decl(var))
+    =E2=94=82   =E2=94=82     - QAST::Var(contextual $*CTXSAVE)
+    =E2=94=82   =E2=94=82   - QAST::Op(unless)
+    =E2=94=82   =E2=94=82     - QAST::Op(isnull)
+    =E2=94=82   =E2=94=82       - QAST::Var(local ctxsave)
+    =E2=94=82   =E2=94=82     - QAST::Op(if)
+    =E2=94=82   =E2=94=82       - QAST::Op(can)
+    =E2=94=82   =E2=94=82         - QAST::Var(local ctxsave)
+    =E2=94=82   =E2=94=82         - QAST::SVal(ctxsave)
+    =E2=94=82   =E2=94=82       - QAST::Op(callmethod ctxsave)
+    =E2=94=82   =E2=94=82         - QAST::Var(local ctxsave)
+    =E2=94=82   =E2=94=82 - QAST::Stmts
+    =E2=94=82   =E2=94=82   - QAST::WVal(Array)
+    =E2=94=82   =E2=94=82   - QAST::Stmt <sunk final> so \"test\".IO.d.B=
ool
+    =E2=94=82   =E2=94=82     - QAST::Want <sunk>
+    =E2=94=82   =E2=94=82       - QAST::Op(callstatic &prefix:<so>) <sun=
k>=20
:statement_id<1> so
+    =E2=94=82   =E2=94=82         - QAST::Op(hllize) <wanted>
+    =E2=94=82   =E2=94=82           - QAST::Op(callmethod Bool)  Bool
+    =E2=94=82   =E2=94=82             - QAST::Op(hllize) <wanted>
+    =E2=94=82   =E2=94=82               - QAST::Op(callmethod d)  d
+    =E2=94=82   =E2=94=82                 - QAST::Op(hllize) <wanted>
+    =E2=94=82   =E2=94=82                   - QAST::Op(callmethod IO)  I=
O
+    =E2=94=82   =E2=94=82                     - QAST::Want <wanted> test=

+    =E2=94=82   =E2=94=82                       - QAST::WVal(Str)
+    =E2=94=82   =E2=94=82                       - Ss
+    =E2=94=82   =E2=94=82                       - QAST::SVal(test)
+    =E2=94=82   =E2=94=82       - v
+    =E2=94=82   =E2=94=82       - QAST::Op(p6sink)
+    =E2=94=82   =E2=94=82         - QAST::Op(callstatic &prefix:<so>) <s=
unk>=20
:statement_id<1> so
+    =E2=94=82   =E2=94=82           - QAST::Op(hllize) <wanted>
+    =E2=94=82   =E2=94=82             - QAST::Op(callmethod Bool)  Bool
+    =E2=94=82   =E2=94=82               - QAST::Op(hllize) <wanted>
+    =E2=94=82   =E2=94=82                 - QAST::Op(callmethod d)  d
+    =E2=94=82   =E2=94=82                   - QAST::Op(hllize) <wanted>
+    =E2=94=82   =E2=94=82                     - QAST::Op(callmethod IO) =
 IO
+    =E2=94=82   =E2=94=82                       - QAST::Want <wanted> te=
st
+    =E2=94=82   =E2=94=82                         - QAST::WVal(Str)
+    =E2=94=82   =E2=94=82                         - Ss
+    =E2=94=82   =E2=94=82                         - QAST::SVal(test)
+    =E2=94=82   =E2=94=82   - QAST::WVal(Nil)
0
perl6
5/18/2020 9:19:16 PM
--0OAP2g/MAC+5xKAE
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, May 18, 2020 at 12:35:47PM -0700, ToddAndMargo via perl6-users wrot=
e:
> On 2020-05-17 22:28, Paul Procacci wrote:
> > Don't 'say' anything.=C2=A0 Just let the optimizer spit out the QAST th=
at you
> > are interested in looking at.
> > The following spits out a diff after optimization:
> >=20
> > # diff -u <(perl6 --target=3Doptimize -e '"test".IO.e') <(perl6
> > --target=3Doptimize -e '"test".IO.e.Bool')
> >=20
> >  >> Huh.=C2=A0 Not sure what I am looking at
> >=20
> > You aren't specific.=C2=A0 Is it the error message you received because=
 you
> > used 'say' improperly or is it the QAST?
> > - How to use 'say' is in the documentation.
> > - A QAST is pretty close to an AST and I'd start there on wikipedia or
> > something.
>=20
> I was looking for the difference between
>=20
> 'say if "test".IO.d',  and

Please note that in my example a couple of messages ago I did not write
"say if 'h:/'.IO.d", I wrote "say 'yes' if 'h:/'.IO.d". The difference
is very important and leads directly to the error-like message you got.

> 'say "test".IO.d.Bool'
>=20
> This is were 'if" has to unscramble a "True" or
> "text message" return.
>=20
> But, I have no idea what all that stuff is that comes
> back anyway, so I think I will give up.

It's the internal representation of the program you told Raku to parse
and execute; the truth is that, just like in a sci-fi story about
a machine that is supposed to answer any question, but only comes back
with "the question has not been asked correctly", and just as with using
low-level debugging tools like strace on Unix-like systems, to ask
the right question one already needs to know most of the answer.
The QAST is most useful to those who already have some idea how
a compiler generally works, how a pseudocode virtual machine works,
how a just-in-time compiler works, and how they all handle different
expressions and the relationships between different types.

G'luck,
Peter

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

--0OAP2g/MAC+5xKAE
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEELuenpRf8EkzxFcNUZR7vsCUn3xMFAl7C/KkACgkQZR7vsCUn
3xO9Vg/9GUK4m93JZl5GO1lGtY4GRGNcY2rIKw4RyxNV8O8vQ9PaxH9nTwr9syEh
3dvUUHekoCsBSX2VQhGK8wlzHUeBBUDigkWwBGSSCCn5tmatK2RnerA2rRZ4/EsA
if90so3DraAk3i/LYhT3K2OOqngZFJAjj/6ptOJkWbNjHr1iLfgzpni0Az4TgyUZ
a3BPU3GJUrPZA+u2oIiwfTyYG2cn2q6ApNWnvv3Spd5L8tWsNXzyZGCeYx4vXHN4
YGz9SW1BLQhtDGjY7PRpoM0CD2NnFovCcZeRlYEBq0t6yoLPyxcBD6JsmkOG8c96
ON8WSNiChTNRij4QmEXXSEDO7vigp/x0k/mVpw8hIOhS15Dz3WFmfktSuZ4NLWPk
B9fNi5yLdSi5vm3rJudzTKxHckRXnqDnoPqVbpxtAZlfbMTcu7G9D82lNmpdPHfq
he+4P1zUp5Lv80C2JgQTQ+6Ei5OmfeWPrLy+CttBN0SQFS5hYdaOYXfU7omtMmm/
oiohXLCLCnX2YgU8XTEvpj/CYVtiBHasM2BVHK3Thi3jdR18RVwVaixGac7ivWne
TaL9lwdk6iwvy7qNVo9O3Zel3Rbz3SehICVapWXiHbO7j+KvmsDXPMUynb8g+xCI
/+Gf4FnzLBxE1DoOExKu/3Myt3CizgywRRlcPwsSkYOh89OG4cI=
=KDjT
-----END PGP SIGNATURE-----

--0OAP2g/MAC+5xKAE--
0
roam
5/18/2020 9:22:54 PM
--/04w6evG8XlLl3ft
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, May 19, 2020 at 12:22:55AM +0300, Peter Pentchev wrote:
> On Mon, May 18, 2020 at 12:35:47PM -0700, ToddAndMargo via perl6-users wr=
ote:
> > On 2020-05-17 22:28, Paul Procacci wrote:
> > > Don't 'say' anything.=C2=A0 Just let the optimizer spit out the QAST =
that you
> > > are interested in looking at.
> > > The following spits out a diff after optimization:
> > >=20
> > > # diff -u <(perl6 --target=3Doptimize -e '"test".IO.e') <(perl6
> > > --target=3Doptimize -e '"test".IO.e.Bool')
> > >=20
> > >  >> Huh.=C2=A0 Not sure what I am looking at
> > >=20
> > > You aren't specific.=C2=A0 Is it the error message you received becau=
se you
> > > used 'say' improperly or is it the QAST?
> > > - How to use 'say' is in the documentation.
> > > - A QAST is pretty close to an AST and I'd start there on wikipedia or
> > > something.
> >=20
> > I was looking for the difference between
> >=20
> > 'say if "test".IO.d',  and
>=20
> Please note that in my example a couple of messages ago I did not write
> "say if 'h:/'.IO.d", I wrote "say 'yes' if 'h:/'.IO.d". The difference
> is very important and leads directly to the error-like message you got.
>=20
> > 'say "test".IO.d.Bool'
> >=20
> > This is were 'if" has to unscramble a "True" or
> > "text message" return.
> >=20
> > But, I have no idea what all that stuff is that comes
> > back anyway, so I think I will give up.
>=20
> It's the internal representation of the program you told Raku to parse
> and execute; the truth is that, just like in a sci-fi story about
> a machine that is supposed to answer any question, but only comes back
> with "the question has not been asked correctly", ...

In case anybody is curious,
http://www.gutenberg.org/cache/epub/33854/pg33854.txt

G'luck,
Peter

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

--/04w6evG8XlLl3ft
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEELuenpRf8EkzxFcNUZR7vsCUn3xMFAl7C/XEACgkQZR7vsCUn
3xMuNRAAp/bTIvxnw536gWNHvBmi1uTBfK4bFpEPc0YWwuV2da0UxZyAZtXayLWT
r2JnId7NAEn6aEP9UV1a6JQuUPTZS752Zqkg0A5jvM88leM3dqCpmPXR1XWx0RtW
sQlxpK1EAky8+jmp5yWVj/hHlsbo6KI0qi15p4TXEOQ6+EQ7IqgcwgwWj7WyDmco
aP49NLs6vxXpieWD8TwRpapVK1viPNeVcAOtKUkwV8an7uH1QyvMIHyPAS1jefyv
n7pS+wbF52V+ExRnOAppVNZR2NqCAQ7ws0J+jkAeYTntgVHGRO/xcIpcC1xB+bFB
fFBrHamTfERUjEpBK+ZU4hgxsO7MoU9fDOynKGIiT6XYDoFDRMfAsB//yEaI9/eR
gxqG59OBJPPmEbob0xlYAGep/pRtsQdjbjNUMCCoI+2zFIh8omUj3IEZFnR2Jham
4Y4wJ3eWuJd80pHAT0NK4EpDyeFlkLDYEGI8Xo6L0VSRPZWhLHHMJWIuP5I+p1ar
ygX1ykMfBcgzHbDAloEM3dtpIVZ3DBb4Zc99MoEzTkQS+Ap7X7LC8Miizvbw7msN
VgoweALeU5Pv3c2sUrVFl6GMCqLo29/XjJ88gBrlEPOBrvk0kwsIjGiIeQ/dLONK
/kqkMN9lPwgoTLE8Si01j1kpy66OxcMAHiHodkWCAiYNwFMF1O8=
=KwIl
-----END PGP SIGNATURE-----

--/04w6evG8XlLl3ft--
0
roam
5/18/2020 9:26:10 PM
On 2020-05-18 14:22, Peter Pentchev wrote:
> Please note that in my example a couple of messages ago I did not write
> "say if 'h:/'.IO.d", I wrote "say 'yes' if 'h:/'.IO.d". The difference
> is very important and leads directly to the error-like message you got.


Hi Peter,

I as interested in the .d difference, so I put that
in instead.

But it does not matter.  I can't tell what I am looking at
so it does not matter anyway

Thank you for all the wonderful help!

-T
0
perl6
5/18/2020 9:32:49 PM
--6a4z/rxILaXg6B+u
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, May 18, 2020 at 02:32:49PM -0700, ToddAndMargo via perl6-users wrot=
e:
> On 2020-05-18 14:22, Peter Pentchev wrote:
> > Please note that in my example a couple of messages ago I did not write
> > "say if 'h:/'.IO.d", I wrote "say 'yes' if 'h:/'.IO.d". The difference
> > is very important and leads directly to the error-like message you got.
>=20
>=20
> Hi Peter,
>=20
> I as interested in the .d difference, so I put that
> in instead.
>=20
> But it does not matter.  I can't tell what I am looking at
> so it does not matter anyway

My point is that you put a bare "say" without telling it *what* to say,
which does something quite specific in both Perl and Raku. That should,
at least, explain the error-like message.

G'luck,
Peter

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

--6a4z/rxILaXg6B+u
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEELuenpRf8EkzxFcNUZR7vsCUn3xMFAl7C/7wACgkQZR7vsCUn
3xPNTRAAlNOtaXc6UjZJWz9Wedu+i3st0vfkJOnUIKoaThhg0HZBGk8L/+quN2z8
N+dHsL6KqRjDoGHlzZfpOYothl5lsxxq7IXph04tUbuN1FHEM6zUWl9n8yUT1x/J
wu6TwpRKU3wv5IQZ8Pd893RLzsNyx28i+fQClvakiLsoHEDavq18lrL9YpcK+sMo
im3vUvgx0F3a5a8+ZxK/GEEi3VlQk284TY7pjMJWyxUMpVUbtp5iDlXbt/RFe+3Y
qPMWR4whgua2sTIqt0dFEagXVjdhso7r/mnHqf+wtUQyoC8o5dtwC6ddyS7iC2Jq
+ka4JY1cHYVmp3hQgbURFI8MLSIQZwjlISa/BAG6L8E5swXsumjloDIz45eKx7ek
8RkQRNkC1jjQdlAWueAGHxAeVKoU3MMLPDbCiWXxlgTcjn1GDdzyTwyXzoTsQURz
LeEqN6pRq+cNq+u3mcWabXP2qKocrJapGux2jZeNA3WUc+XCkS95u9uO9IiWQrb8
7aPKCKs1bODOVv9dqHHk/1MPKylXD7rZNFGpbFQwZfkjdPtc0o5sHqUr7hr/uD4m
LVzy+B8x3iAjbBPKsQWBAanV2mqJMf4svhCXpwJFA+mrXbAMzlSU1iHtvraR5/30
OfDVwGhVwYkxfHjUX55JPBexNYKdn7oqoe1eleAmz0t+00wfET4=
=KerT
-----END PGP SIGNATURE-----

--6a4z/rxILaXg6B+u--
0
roam
5/18/2020 9:35:56 PM
On 2020-05-18 14:35, Peter Pentchev wrote:
> My point is that you put a bare "say" without telling it*what*  to say,
> which does something quite specific in both Perl and Raku. That should,
> at least, explain the error-like message.
> 
> G'luck,
> Peter

What I was after was to see what impact I had coercing a
Bool to a Bool verses coercing a half a Bool and unless
text message to a Bool.

But, you know, I am using a (very) high lever language
for a reason.  I can get to the final product twice as
fast.  If I wanted to optimize the use of my CPU, I would
program in C, or if I was REALLY masochistic, I program
in Assembly.  (Done that, don't want to do it again!)

So my little coercing Bool to Bool so I do not have to
remember which IO.soemletter is or is not returning an
actual Boolean is a mute point.  I am already wasting
a ton of CPU by being in a high level language to start with.

And I don't care.  My computer is a bazillion times more powerful than 
any thing I waste on a high level language.
It hardly notices my "indiscretion"

An gee wiz, Raku is a TON more human readable than C,
which gives me a migraine if I stare at it too long.
Raku is far more maintainable.  But that is just my opinion
0
perl6
5/18/2020 10:18:26 PM
--Th5JPit8I3Q6/gDv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, May 18, 2020 at 03:18:26PM -0700, ToddAndMargo via perl6-users wrot=
e:
> On 2020-05-18 14:35, Peter Pentchev wrote:
> > My point is that you put a bare "say" without telling it*what*  to say,
> > which does something quite specific in both Perl and Raku. That should,
> > at least, explain the error-like message.
> >=20
> > G'luck,
> > Peter
>=20
> What I was after was to see what impact I had coercing a
> Bool to a Bool verses coercing a half a Bool and unless
> text message to a Bool.
[snip another explanation of why you use .Bool, which I already
 said that I am not commenting on; my point is something entirely
 different]

All I was trying to say was to explain that "say if something" and
"say 'foo' if something" do different things, to answer your question
=66rom a previous message why "say if something" told you something
about undefined values. That's all I was trying to help you with :)

G'luck,
Peter

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

--Th5JPit8I3Q6/gDv
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEELuenpRf8EkzxFcNUZR7vsCUn3xMFAl7DDmQACgkQZR7vsCUn
3xOGiA/+O+Z8LOS9DuosfHUjaAP8eBC2gaO0stKmXUT8gRPe+SXimN1mVANK3Ej3
DtRbbYRSHNLWscBFHLrglH3eHrIgwNgzpWBt4dXcqTv3P9IQLJKedgtPVRXMOWcW
8m1w12A+AR3Ed9HU/UQFOXmGmlEsNHkYQqybObl55qApUcg/yyK4xuzwmmHpgqv3
zI6V1nq96T5epmLFGVm0SJjj6QP58YV6aTV3VUQ6VmI1npN4ersCtwSgUM8dxoFg
EAW+5dCdElpgEZ872s6a8ZXcCKcu1z0g8ygJQpXQ+V2b9wziukfGwdWt0apNu7Xx
ECDN4Y3ptZltgeZA4QTNp3LWFAjtlTpWQE86nHVXf682YOd+zY2woGcZ8OhZXLDL
H+i8pqU14PFzhYLDA3zagUHTjGfZ6S6aHjqRRRHj6iZstcDFbVjAJDfVC20qInIy
IKGfj/Wim+ISI4vMyxo8WdLfHHQsrWlvDnlW1LTt7fCLoShv9O38ijHp2O4Vq3FS
dle+Id0BNeCtC2YGpsYGX7v4iBnKc+l2Ut1uIynwYHWyy1OBePMtUtW/W1uAkOnl
9nfxmXydFFl4KxEVp3KpBHHLlABouCByALu/dxbAPDXmq/wswCbWeFp848TByfvr
7ZCgcCaBWPDmv4vkqcm+Cv3mtx7TxG6bpw2Qz0U+5ewr+x2Dd20=
=ZSZV
-----END PGP SIGNATURE-----

--Th5JPit8I3Q6/gDv--
0
roam
5/18/2020 10:38:33 PM
On 2020-05-18 15:38, Peter Pentchev wrote:
> On Mon, May 18, 2020 at 03:18:26PM -0700, ToddAndMargo via perl6-users wrote:
>> On 2020-05-18 14:35, Peter Pentchev wrote:
>>> My point is that you put a bare "say" without telling it*what*  to say,
>>> which does something quite specific in both Perl and Raku. That should,
>>> at least, explain the error-like message.
>>>
>>> G'luck,
>>> Peter
>>
>> What I was after was to see what impact I had coercing a
>> Bool to a Bool verses coercing a half a Bool and unless
>> text message to a Bool.
> [snip another explanation of why you use .Bool, which I already
>   said that I am not commenting on; my point is something entirely
>   different]
> 
> All I was trying to say was to explain that "say if something" and
> "say 'foo' if something" do different things, to answer your question
> from a previous message why "say if something" told you something
> about undefined values. That's all I was trying to help you with :)
> 
> G'luck,
> Peter
> 

I got it.  I was only rambling on.  I tend to do that.
0
perl6
5/18/2020 10:41:49 PM
--00000000000088d3b705a5f3e97f
Content-Type: text/plain; charset="UTF-8"

On Mon, May 18, 2020 at 16:19 ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:

> On 2020-05-18 13:28, Tom Browder wrote:

....

> > Try:
> >
> > 'say so "test".IO.d'


Todd, you didn't try what I suggested. Once again, look a the line above^^

There is no "if" there.

-Tom

--00000000000088d3b705a5f3e97f
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div>On Mon, May 18, 2020 at 16:19 ToddAndMargo via perl6-users &lt;<a href=
=3D"mailto:perl6-users@perl.org">perl6-users@perl.org</a>&gt; wrote:<br></d=
iv><div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 2020-=
05-18 13:28, Tom Browder wrote:</blockquote><div dir=3D"auto">...</div><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #c=
cc solid;padding-left:1ex">&gt; Try:<br>
&gt; <br>
&gt; &#39;say so &quot;test&quot;.IO.d&#39;</blockquote><div dir=3D"auto"><=
br></div><div dir=3D"auto">Todd, you didn&#39;t try what I suggested. Once =
again, look a the line above^^</div><div dir=3D"auto"><br></div><div dir=3D=
"auto">There is no &quot;if&quot; there.</div><div dir=3D"auto"><br></div><=
div dir=3D"auto">-Tom</div><div dir=3D"auto"><br></div></div></div>

--00000000000088d3b705a5f3e97f--
0
tom
5/18/2020 10:44:45 PM
On 2020-05-18 15:44, Tom Browder wrote:
> On Mon, May 18, 2020 at 16:19 ToddAndMargo via perl6-users 
> <perl6-users@perl.org <mailto:perl6-users@perl.org>> wrote:
> 
>     On 2020-05-18 13:28, Tom Browder wrote:
> 
> ...
> 
>      > Try:
>      >
>      > 'say so "test".IO.d'
> 
> 
> Todd, you didn't try what I suggested. Once again, look a the line above^^
> 
> There is no "if" there.
> 
> -Tom
> 

It was the "if" I was interested in.  "if" has to change
a True or "useless text message" into a True or False.

Anyway, since I don't understand anything that came
back, I am going to give up.

And besides, any extra work I am giving the compiler
with my coercing a Bool into a Bool so I don't
remember which IO.someletter give back an actual
Boolean and which ones don't, is SWAMPED by my use
of a high level language.  This is not Assembly.
0
perl6
5/18/2020 10:51:30 PM
--000000000000ee3da505a5f42372
Content-Type: text/plain; charset="UTF-8"

On Mon, May 18, 2020 at 17:51 ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:

> On 2020-05-18 15:44, Tom Browder wrote:
> > On Mon, May 18, 2020 at 16:19 ToddAndMargo via perl6-users
> > <perl6-users@perl.org <mailto:perl6-users@perl.org>> wrote:
> >
> >     On 2020-05-18 13:28, Tom Browder wrote:
> >
> > ...
> >
> >      > Try:
> >      >
> >      > 'say so "test".IO.d'
> >
> >
> > Todd, you didn't try what I suggested. Once again, look a the line
> above^^
> >
> > There is no "if" there.
> >
> > -Tom
> >
>
> It was the "if" I was interested in.  "if" has to change
> a True or "useless text message" into a True or False.


Since you don't like to listen to advice I give up. The 'so' I was taught
by lizmat (or some other expert) a long time ago does the pretty much the
same thing  execpt it makes a valid statement, whereas I'm not sure the
other way does (hard to read your emails with all the superflous output).

--000000000000ee3da505a5f42372
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div>On Mon, May 18, 2020 at 17:51 ToddAndMargo via perl6-users &lt;<a href=
=3D"mailto:perl6-users@perl.org">perl6-users@perl.org</a>&gt; wrote:<br></d=
iv><div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 2020-=
05-18 15:44, Tom Browder wrote:<br>
&gt; On Mon, May 18, 2020 at 16:19 ToddAndMargo via perl6-users <br>
&gt; &lt;<a href=3D"mailto:perl6-users@perl.org" target=3D"_blank">perl6-us=
ers@perl.org</a> &lt;mailto:<a href=3D"mailto:perl6-users@perl.org" target=
=3D"_blank">perl6-users@perl.org</a>&gt;&gt; wrote:<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0On 2020-05-18 13:28, Tom Browder wrote:<br>
&gt; <br>
&gt; ...<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; Try:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; &#39;say so &quot;test&quot;.IO.d&#39;<br>
&gt; <br>
&gt; <br>
&gt; Todd, you didn&#39;t try what I suggested. Once again, look a the line=
 above^^<br>
&gt; <br>
&gt; There is no &quot;if&quot; there.<br>
&gt; <br>
&gt; -Tom<br>
&gt; <br>
<br>
It was the &quot;if&quot; I was interested in.=C2=A0 &quot;if&quot; has to =
change<br>
a True or &quot;useless text message&quot; into a True or False.</blockquot=
e><div dir=3D"auto"><br></div><div dir=3D"auto">Since you don&#39;t like to=
 listen to advice I give up. The &#39;so&#39; I was taught by lizmat (or so=
me other expert) a long time ago does the pretty much the same thing =C2=A0=
execpt it makes a valid statement, whereas I&#39;m not sure the other way d=
oes (hard to read your emails with all the superflous output).</div><div di=
r=3D"auto"><br></div></div></div>

--000000000000ee3da505a5f42372--
0
tom
5/18/2020 11:01:05 PM
--KJKxYQkVikLexIKR
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, May 18, 2020 at 03:51:30PM -0700, ToddAndMargo via perl6-users wrot=
e:
> On 2020-05-18 15:44, Tom Browder wrote:
> > On Mon, May 18, 2020 at 16:19 ToddAndMargo via perl6-users
> > <perl6-users@perl.org <mailto:perl6-users@perl.org>> wrote:
> >=20
> >     On 2020-05-18 13:28, Tom Browder wrote:
> >=20
> > ...
> >=20
> >      > Try:
> >      >
> >      > 'say so "test".IO.d'
> >=20
> >=20
> > Todd, you didn't try what I suggested. Once again, look a the line abov=
e^^
> >=20
> > There is no "if" there.
> >=20
> > -Tom
> >=20
>=20
> It was the "if" I was interested in.  "if" has to change
> a True or "useless text message" into a True or False.

No, that's not what "if" does. "If" in Raku works pretty much
the same way as "if" in Perl: it takes an expression as
an argument, checks whether the expression is true or false
(that's the part where it takes any value and does a .Bool on
it - by itself - and then looks at the result), and then, if
it was true, the "if" statement runs another part of the code.
So:

    if 'h:/'.IO.d {
        say 'It is a directory!';
    }

=2E..will take the string 'h:/', the .IO method will convert it to
a path, the .d method will check whether the path corresponds to
a valid directory at this moment, and then the "if" statement will
check the result of this whole thing and decide whether to run
the { say... } block. If the path is a directory, it will tell you
that it is a directory. If the expression is true, it runs the code.

The postfix "if" also works in pretty much the same way as in Perl:
it allows you to shorten this:

    if 'h:/'.IO.d {
        say 'It is a directory!';
    }

=2E..to this:

    say 'It is a directory!' if 'h:/'.IO.d;

Now you will note that in my example I did *not* write
"say if 'h:/'.IO.d", because I did not expect the "if" to return
a value; I wrote "say 'foo' if 'h:/'.IO.d" since I expected the "if"
statement to make Raku check whether 'h:/'.IO.d returns something that
looks like truth and, if it does, to execute the "say 'foo'" part.

I'm sorry, I assumed that you were familiar with the postfix "if" form
(something if something-else). Maybe you did not recognize it as such,
sorry.

As an exercise for the reader: once the above sinks in, what exactly
will "say if 'h:/'.IO.d" do? :)

G'luck,
Peter

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

--KJKxYQkVikLexIKR
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEELuenpRf8EkzxFcNUZR7vsCUn3xMFAl7DFgMACgkQZR7vsCUn
3xPiZQ//UVVnXiliiNN4+7NRmJ+t2EA0qgWhluaY9ySoC7s09ao6GAJfGUJG03aM
m4RgE1z9Jvjz9OxpwoiIZ251KGRxm6ZZ3Mwah8/pfyttokECgB/hYAnx+VksI4Aq
vPRe2lyd/luRp4xmnnyEKSWivDlm7aJfUei1BVHjvF6Q/FQnDFoCR/nEv+35+K26
V1W5/RiVRyfbZmJ9arVACdFP/FEa/XDb1faFH3WGmyrQi7ek34x5eziKbPw3w6kP
Dq4j9jN3TrsUaDddXhqqzQRpqjmwZONL1NDWF5FZqPzelVR5yQmnw95GpHQMeJKH
G2L6+zeusKSLhF+6TnHnY1LXV8KG+rx6qpeB6gNQ3BZxd6S3jgkIBEMwOFLFS90v
eIJO9nW4OCm6zIg2WNnAoS5kCr+w254AA+vGHaw3vW+IsdWFud2gJLDrRCwsnpxV
CYx1+jLFcD9A28d3LgYF89VIugPW2IFfG9WQJyQUjtkbUiBMwL0aQvrJM+lkEv6x
RrZ/CMPdCit6RMg3NdKe79HoyWpaOL3hg889hke8vUE9r/GFb851fC0YnPANyWXR
u4CbwLPc+J2DLuFXf+NyF1A2zw90hocM/zway0ygMiNYv2cVvc3chSyG+OmbOcAS
YQ596vi51uWldc9+SeozGF2UiNLnqfXu4yVIiGrTiHya9TPU+HI=
=5r8D
-----END PGP SIGNATURE-----

--KJKxYQkVikLexIKR--
0
roam
5/18/2020 11:11:04 PM
On 2020-05-18 16:01, Tom Browder wrote:
> Since you don't like to listen to advice I give up.

Tom!

I listen to your advice ALL-THE-TIME.  I was
just interested in something else.  And when I did
not understand the result, your way or my way,
I abandoned the effort, especially since I did not
need the information.  It was just a curiosity.

Don't for a second think I do not value your advice!

-T
0
perl6
5/18/2020 11:51:33 PM
In 2020-05-18 16:11, Peter Pentchev wrote:
> As an exercise for the reader: once the above sinks in, what exactly
> will "say if 'h:/'.IO.d" do?

It returns the the result of the expression that
"if" evaluated.

I do know all this.  It is easier for me to read
the other way.
0
perl6
5/18/2020 11:53:31 PM
--G32kpiKURVjWs3Ul
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, May 18, 2020 at 04:53:31PM -0700, ToddAndMargo via perl6-users wrot=
e:
> In 2020-05-18 16:11, Peter Pentchev wrote:
> > As an exercise for the reader: once the above sinks in, what exactly
> > will "say if 'h:/'.IO.d" do?
>=20
> It returns the the result of the expression that
> "if" evaluated.

OK, so why does it give you an error message if you run it? :)

Not quite.

    say if 'h:/'.IO.d

=2E..is equivalent to:

    if 'h:/'.IO.d {
        say;
    }

=2E...which would have been valid in Perl (apart from the parentheses
around the condition of the "if", Raku allows you to omit those), but
it is not valid Raku. Run it and see what it says.

Once again you thought that "if" returns a value. "If" does not return
a value, it is not a function, it is a statement. Just the same as "for"
does not return a value, and "while" does not return a value.

G'luck,
Peter

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

--G32kpiKURVjWs3Ul
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEELuenpRf8EkzxFcNUZR7vsCUn3xMFAl7DJPcACgkQZR7vsCUn
3xPkfBAAnnZFDesGFMmDMtBdtTO9gQFBWNid1b5HZF4J1ESBfopt1dOKDudMc5xN
1/HTFpsQdrvIOJG4+YLibuoxNvB6x/TRI33mpdv++mNuJLF86BiDU9JJpV7Y1xgP
fUa2J9klJEnknoOR2VwWvthKHa0ES6idEAR9sLgnsMaM7kCd7NmS0ExWgyj/zU/D
ZO0rBJGgAZYY/MDDTxzeAsEfdsg1TqO93uQXQcmi3ezwpiIhJXe1leoCbfPEdccL
x8jeuMorU0de1biNfoMMLz2H3/53I5NYhPsP3CJkM23cirg13SbCuZzJTfLmVU8i
ek5uB3uzQQlw8N1utlgXl+nxpAlxz6fyG1nqVfFaPcyzWGAguJY0vOutflWcoXAe
yiDJw81pfzAqnBNQI/byNZwIlqy8eUfQ+ktj7YXeu+FKUHi2PqkkYyrAbaOdLGqU
BUDo3m/6yhfa2uHmUE3a6TV3GDXuYqlBubwGMJMpazL6NL4EUMW18xAbK8fBZMoD
6f/dPKF00ac1tE46y5VivkFm5qdLSh1VsQ/RgmeEM5utmoMwdd3lxwuSQtvqEoP2
wpUTb5PXVtfk3fqiJNvqYiVfImR3FOZ+gM75c3vZ2ImlFfMQg9IspVspaltCu7iE
jCIuod6PR6Iui/K8rX2B9vQhsvN8GLuBJgE7pPTuKVmEZyHP/8I=
=Z+3y
-----END PGP SIGNATURE-----

--G32kpiKURVjWs3Ul--
0
roam
5/19/2020 12:14:52 AM
On 2020-05-18 17:14, Peter Pentchev wrote:
> On Mon, May 18, 2020 at 04:53:31PM -0700, ToddAndMargo via perl6-users wrote:
>> In 2020-05-18 16:11, Peter Pentchev wrote:
>>> As an exercise for the reader: once the above sinks in, what exactly
>>> will "say if 'h:/'.IO.d" do?
>>
>> It returns the the result of the expression that
>> "if" evaluated.
> 
> OK, so why does it give you an error message if you run it? :)
> 
> Not quite.
> 
>      say if 'h:/'.IO.d
> 
> ...is equivalent to:
> 
>      if 'h:/'.IO.d {
>          say;
>      }
> 
> ....which would have been valid in Perl (apart from the parentheses
> around the condition of the "if", Raku allows you to omit those), but
> it is not valid Raku. Run it and see what it says.
> 
> Once again you thought that "if" returns a value. "If" does not return
> a value, it is not a function, it is a statement. Just the same as "for"
> does not return a value, and "while" does not return a value.
> 
> G'luck,
> Peter
> 

Hi Peter,

Of course!  I am not arguing with anyone that
they are not right!

I am doing what I am doing to make things easier for
me to read in the future.  Since I am already using
a very high level language, what is one more affront
to my CPU?

:-)

-T
0
perl6
5/19/2020 5:58:26 AM
On 2020-05-18 22:58, ToddAndMargo via perl6-users wrote:
> On 2020-05-18 17:14, Peter Pentchev wrote:
>> On Mon, May 18, 2020 at 04:53:31PM -0700, ToddAndMargo via perl6-users=
=20
>> wrote:
>>> In 2020-05-18 16:11, Peter Pentchev wrote:
>>>> As an exercise for the reader: once the above sinks in, what exactly=

>>>> will "say if 'h:/'.IO.d" do?
>>>
>>> It returns the the result of the expression that
>>> "if" evaluated.
>>
>> OK, so why does it give you an error message if you run it? :)
>>
>> Not quite.
>>
>> =C2=A0=C2=A0=C2=A0=C2=A0 say if 'h:/'.IO.d
>>
>> ...is equivalent to:
>>
>> =C2=A0=C2=A0=C2=A0=C2=A0 if 'h:/'.IO.d {
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 say;
>> =C2=A0=C2=A0=C2=A0=C2=A0 }
>>
>> ....which would have been valid in Perl (apart from the parentheses
>> around the condition of the "if", Raku allows you to omit those), but
>> it is not valid Raku. Run it and see what it says.
>>
>> Once again you thought that "if" returns a value. "If" does not return=

>> a value, it is not a function, it is a statement. Just the same as "fo=
r"
>> does not return a value, and "while" does not return a value.
>>
>> G'luck,
>> Peter
>>
>=20
> Hi Peter,
>=20
> Of course!=C2=A0 I am not arguing with anyone that
> they are not right!
>=20
> I am doing what I am doing to make things easier for
> me to read in the future.=C2=A0 Since I am already using
> a very high level language, what is one more affront
> to my CPU?
>=20
> :-)
>=20
> -T

Peter,

I am not a full time programmer.  I am I.T. support
to small busienses.  Programming is only about 10
to 20% of what I do.  Wednesday, I get to fix an
sql server installer that things it is being given
the wrong (speaking) language.  I DO EVERYTHING !!!

The things I write MUST be maintainable.  When I go back
to them, I won't remember everything on the fly.  EVEN
THOUGH I have copous notes and HOW TOs.

If you want me to change my wicked way, come up with
something even more understandable, human readable
"on the fly".

And with the talent you have already displayed, I know
you can.  You are very, very good at this stuff.

:-)

-T
0
perl6
5/19/2020 6:33:42 AM
Peter,

What a genius answer!

The transcendental abundance of purple in Raku :)

On 18/05/2020 22:26, Peter Pentchev wrote:
> <snip>It's the internal representation of the program you told Raku to 
> parse
>> and execute; the truth is that, just like in a sci-fi story about
>> a machine that is supposed to answer any question, but only comes back
>> with "the question has not been asked correctly", ...
> In case anybody is curious,
> http://www.gutenberg.org/cache/epub/33854/pg33854.txt
>
> G'luck,
> Peter
>
0
rnhainsworth
5/19/2020 8:44:33 AM
--00000000000059025d05a5fdbfe7
Content-Type: text/plain; charset="UTF-8"

On Tue, May 19, 2020 at 03:44 Richard Hainsworth <rnhainsworth@gmail.com>
wrote:

> The transcendental abundance of purple in Raku :)


Ah, Richard, thanks for a trip down memory lane! In my youth I discovered
the joys of science fiction a few years after that piece was published.

-Tom

--00000000000059025d05a5fdbfe7
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div>On Tue, May 19, 2020 at 03:44 Richard Hainsworth &lt;<a href=3D"mailto=
:rnhainsworth@gmail.com">rnhainsworth@gmail.com</a>&gt; wrote:</div><div><d=
iv class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:=
0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The transcendental abundance of purple in Raku :)</blockquote><div dir=3D"a=
uto"><br></div><div dir=3D"auto">Ah, Richard, thanks for a trip down memory=
 lane! In my youth I discovered the joys of science fiction a few years aft=
er that piece was published.</div><div dir=3D"auto"><br></div><div dir=3D"a=
uto">-Tom</div></div></div>

--00000000000059025d05a5fdbfe7--
0
tom
5/19/2020 10:28:47 AM
--Nwn6wlxaqfRJxJFc
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, May 18, 2020 at 10:58:26PM -0700, ToddAndMargo via perl6-users wrot=
e:
> On 2020-05-18 17:14, Peter Pentchev wrote:
> > On Mon, May 18, 2020 at 04:53:31PM -0700, ToddAndMargo via perl6-users =
wrote:
> > > In 2020-05-18 16:11, Peter Pentchev wrote:
> > > > As an exercise for the reader: once the above sinks in, what exactly
> > > > will "say if 'h:/'.IO.d" do?
> > >=20
> > > It returns the the result of the expression that
> > > "if" evaluated.
> >=20
> > OK, so why does it give you an error message if you run it? :)
> >=20
> > Not quite.
> >=20
> >      say if 'h:/'.IO.d
> >=20
> > ...is equivalent to:
> >=20
> >      if 'h:/'.IO.d {
> >          say;
> >      }
> >=20
> > ....which would have been valid in Perl (apart from the parentheses
> > around the condition of the "if", Raku allows you to omit those), but
> > it is not valid Raku. Run it and see what it says.
> >=20
> > Once again you thought that "if" returns a value. "If" does not return
> > a value, it is not a function, it is a statement. Just the same as "for"
> > does not return a value, and "while" does not return a value.
> >=20
> > G'luck,
> > Peter
> >=20
>=20
> Hi Peter,
>=20
> Of course!  I am not arguing with anyone that
> they are not right!
>=20
> I am doing what I am doing to make things easier for
> me to read in the future.  Since I am already using
> a very high level language, what is one more affront
> to my CPU?

Todd, I'm trying to tell you that you seem to misunderstand
what "if" does. Please read my answer again: your idea of
what "say if 'h:/'.IO.d" does is incorrect, "if" does not do
what you think it does, and this is *essential* for understanding
and writing Raku programs (or programs in pretty much any other
language). Understanding the difference between functions and
control statements is *essential*.

G'luck,
Peter

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

--Nwn6wlxaqfRJxJFc
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEELuenpRf8EkzxFcNUZR7vsCUn3xMFAl7DzhwACgkQZR7vsCUn
3xPGzA/+LjxudE4SE+7ATdyTyRkQaPzWTv7thAqDCxeSKlvIig52JoD4picENwGM
4muRyF24iSZBva3l9wO3fF6au/E3pGTgzekbNP9w607nRdZkQQgh7+PFk1b1xEEk
rW6lpdiN4xFvtZWnxHsyQFaFHdVnnp8ZxJcOkBUDjqaGU26Zk5tRTct161cUsxSK
Gsu4cPxXQY7nc57HIYPyM7ZbgFNkSBn6D8YXG+2tpjpI5RAnjwrFyTuAlqI+3Sdl
/SFOAsfElEaakMs7q5YXoNdz4MQLouPCcJ4KjAvnOdeTBg31+4/r/MY/I5n0MSN1
dIe67dWGTmvmRuW9qIi6vkf5FMmUvacuVhy59ltHF4aYCeSFX2W3xT3iF29c7rph
E3mVw9gA7XFKzUy55FWSm+ZsWeh2KMcvFsA8WYzuHRMkWww3Cl7qbXi2HHNvulwM
uHGGs2kn88MjvyMcysBJTZuH4eg4RvjWIbwbcsg34Mjxh74x18zoxmnH4T52vLQl
eZ9MCX7zw9yFRU4IXCQzRauyDM0l5upf8wBZiQd6YxnlC0SXvTcp09Nf5y/nxh14
iqwWAoJeQo5iKJ0d9lB7hn39UvXNm4now0L1Cuw8c6OaLHivRqPkg+PHb4dVv9Db
7TRzGUdElo7lcgDqspr1XY+kl9Mxsu4HEu/9cpSnrEJhe3qtSNI=
=hb+a
-----END PGP SIGNATURE-----

--Nwn6wlxaqfRJxJFc--
0
roam
5/19/2020 12:16:40 PM
--LQksG6bCIzRHxTLp
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, May 19, 2020 at 03:16:41PM +0300, Peter Pentchev wrote:
> On Mon, May 18, 2020 at 10:58:26PM -0700, ToddAndMargo via perl6-users wr=
ote:
> > On 2020-05-18 17:14, Peter Pentchev wrote:
> > > On Mon, May 18, 2020 at 04:53:31PM -0700, ToddAndMargo via perl6-user=
s wrote:
> > > > In 2020-05-18 16:11, Peter Pentchev wrote:
> > > > > As an exercise for the reader: once the above sinks in, what exac=
tly
> > > > > will "say if 'h:/'.IO.d" do?
> > > >=20
> > > > It returns the the result of the expression that
> > > > "if" evaluated.
> > >=20
> > > OK, so why does it give you an error message if you run it? :)
> > >=20
> > > Not quite.
> > >=20
> > >      say if 'h:/'.IO.d
> > >=20
> > > ...is equivalent to:
> > >=20
> > >      if 'h:/'.IO.d {
> > >          say;
> > >      }
> > >=20
> > > ....which would have been valid in Perl (apart from the parentheses
> > > around the condition of the "if", Raku allows you to omit those), but
> > > it is not valid Raku. Run it and see what it says.
> > >=20
> > > Once again you thought that "if" returns a value. "If" does not return
> > > a value, it is not a function, it is a statement. Just the same as "f=
or"
> > > does not return a value, and "while" does not return a value.
> > >=20
> > > G'luck,
> > > Peter
> > >=20
> >=20
> > Hi Peter,
> >=20
> > Of course!  I am not arguing with anyone that
> > they are not right!
> >=20
> > I am doing what I am doing to make things easier for
> > me to read in the future.  Since I am already using
> > a very high level language, what is one more affront
> > to my CPU?
>=20
> Todd, I'm trying to tell you that you seem to misunderstand
> what "if" does. Please read my answer again: your idea of
> what "say if 'h:/'.IO.d" does is incorrect, "if" does not do
> what you think it does, and this is *essential* for understanding
> and writing Raku programs (or programs in pretty much any other
> language). Understanding the difference between functions and
> control statements is *essential*.

=2E..control structures, I mean.

G'luck,
Peter

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

--LQksG6bCIzRHxTLp
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEELuenpRf8EkzxFcNUZR7vsCUn3xMFAl7Dzl4ACgkQZR7vsCUn
3xNmeRAAvaA4KWyk7u4KquNZrzlQNJfpfhYVJblVPSIrm60FzpHFGx1rp3E1oW/2
nXQ7CRWFt0ZHxkzfXOD3ZXHylcJtRDyDom8AbZG5DsirgxECKess4qrk4oTGO2ye
PnfVN68FKWTDuejVGPFQZI4RZjSumjYos/CahG2RXi3r4rLXDp1x2+Xemsaw8WF4
wFElp+PvxyovEWEGvw8pPJNt4cbnfqfyF9JlXfqUilRvRvr8LOX0Rz6AvcRSyTFd
1BT3LbOwWOOY/4bKrlKEbYZjECAqcUhlSGBLQmfGRE8cKINq7Vppoed2G+e+Ir92
aBNpKH+4IMW99p0/xluI0ub+Hy3LWViEMnmh2dyYPwC7+rYZUunIQ5IxfSdmFvRY
VeiWjkqY2ND7Bwgco5xd+QKlL8s3e8mHrrhLSKpOQE4iI9nBZPLOE+2Uc2JPRwQ+
ApEdX6N9A3hLLIcxPzF3eeigzOdlDVEVCOXtYXC5WS0InB7XIYOiniW9UhiHEr0+
zM9Uugu8IIswjY6UgXFAnWxL61qZYEC6D/Fl5TuXxxEQuWkhzI7KEJUsRGshKaX9
UNQoSBVKmwwgV06Q/HPtK/RD5HsrXVvyMbsAGPz+BjKEBV3a2QZ9G5pUBcYJY1NG
HzPcvZhXgThIh28qznNl2pHuUKrzhVFVhxMCwTKtb9rmkf8uOyw=
=NGnh
-----END PGP SIGNATURE-----

--LQksG6bCIzRHxTLp--
0
roam
5/19/2020 12:17:34 PM
On 2020-05-19 05:17, Peter Pentchev wrote:

> ...control structures, I mean.
> 
> G'luck,
> Peter
> 

No problem,

I appreciate all the help!

:-)

-T
0
perl6
5/23/2020 1:33:06 AM
Reply: