<> thank you

Hi All,

I went to reply to someone, I think it was Brandon for sending me
an eMail to my private address and the stinker disappeared!

Anyway whoever sent me

     $ p6 'say <the quick brown>[0,2];'
     (the brown)

I was trying to figure out why this bombed:

     $ p6 ' say "a b c d"[3,1];'
     Index out of range. Is: 3, should be in 0..0
     in block <unit> at -e line 1

And you beat me to the punch!  It was the <>.

Thank you!

-T
0
ToddAndMargo
10/5/2018 6:29:46 AM
perl.perl6.users 1111 articles. 0 followers. Follow

8 Replies
48 Views

Similar Articles

[PageSpeed] 16

--000000000000967dcc057776421a
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Yeah, Todd, the angle brackets operator in <the quick brown> produces a
list of three words which you can access individually with an index,
whereas quotes in  "a b c d" creates a single string. But to come back to
the start of a very long thread of discussion over the last days, if you
want to access individual words of the string, you can of course do this:
> say "a b c d".words[3,1];
(d b)

Cheers, Laurent.



Le ven. 5 oct. 2018 =C3=A0 08:30, Todd Chester <ToddAndMargo@zoho.com> a =
=C3=A9crit :

> Hi All,
>
> I went to reply to someone, I think it was Brandon for sending me
> an eMail to my private address and the stinker disappeared!
>
> Anyway whoever sent me
>
>      $ p6 'say <the quick brown>[0,2];'
>      (the brown)
>
> I was trying to figure out why this bombed:
>
>      $ p6 ' say "a b c d"[3,1];'
>      Index out of range. Is: 3, should be in 0..0
>      in block <unit> at -e line 1
>
> And you beat me to the punch!  It was the <>.
>
> Thank you!
>
> -T
>

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

<div dir=3D"ltr"><div dir=3D"ltr"><div>Yeah,=20
Todd, the angle brackets operator in &lt;the quick brown&gt; produces a lis=
t of three words which you can access individually with an index, whereas=
=20
quotes in=C2=A0 &quot;a b c d&quot; creates a single string. But to come ba=
ck to the start of a very long thread of discussion over the last days, if =
you want to access individual words of the string, you can of course do thi=
s:</div><div>&gt; say &quot;a b c d&quot;.words[3,1];<br>(d b)</div><div><b=
r></div><div>Cheers, Laurent.</div><div><br></div><div><br></div></div></di=
v><br><div class=3D"gmail_quote"><div dir=3D"ltr">Le=C2=A0ven. 5 oct. 2018 =
=C3=A0=C2=A008:30, Todd Chester &lt;<a href=3D"mailto:ToddAndMargo@zoho.com=
">ToddAndMargo@zoho.com</a>&gt; a =C3=A9crit=C2=A0:<br></div><blockquote cl=
ass=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;p=
adding-left:1ex">Hi All,<br>
<br>
I went to reply to someone, I think it was Brandon for sending me<br>
an eMail to my private address and the stinker disappeared!<br>
<br>
Anyway whoever sent me<br>
<br>
=C2=A0 =C2=A0 =C2=A0$ p6 &#39;say &lt;the quick brown&gt;[0,2];&#39;<br>
=C2=A0 =C2=A0 =C2=A0(the brown)<br>
<br>
I was trying to figure out why this bombed:<br>
<br>
=C2=A0 =C2=A0 =C2=A0$ p6 &#39; say &quot;a b c d&quot;[3,1];&#39;<br>
=C2=A0 =C2=A0 =C2=A0Index out of range. Is: 3, should be in 0..0<br>
=C2=A0 =C2=A0 =C2=A0in block &lt;unit&gt; at -e line 1<br>
<br>
And you beat me to the punch!=C2=A0 It was the &lt;&gt;.<br>
<br>
Thank you!<br>
<br>
-T<br>
</blockquote></div>

--000000000000967dcc057776421a--
0
perl6
10/5/2018 7:31:18 AM
>> Le ven. 5 oct. 2018 =C3=A0 08:30, Todd Chester <ToddAndMargo@zoho.com=20
>> <mailto:ToddAndMargo@zoho.com>> a =C3=A9crit :
>>=20
>>     Hi All,
>>=20
>>     I went to reply to someone, I think it was Brandon for sending me
>>     an eMail to my private address and the stinker disappeared!
>>=20
>>     Anyway whoever sent me
>>=20
>>           $ p6 'say <the quick brown>[0,2];'
>>           (the brown)
>>=20
>>     I was trying to figure out why this bombed:
>>=20
>>           $ p6 ' say "a b c d"[3,1];'
>>           Index out of range. Is: 3, should be in 0..0
>>           in block <unit> at -e line 1
>>=20
>>     And you beat me to the punch!  It was the <>.
>>=20
>>     Thank you!
>>=20
>>     -T
>>=20


On 10/5/18 12:31 AM, Laurent Rosenfeld via perl6-users wrote:
> Yeah, Todd, the angle brackets operator in <the quick brown> produces a=
=20
> list of three words which you can access individually with an index,=20
> whereas quotes in=C2=A0 "a b c d" creates a single string. But to come ba=
ck=20
> to the start of a very long thread of discussion over the last days, if=
=20
> you want to access individual words of the string, you can of course do=
=20
> this:
>  > say "a b c d".words[3,1];
> (d b)
>=20
> Cheers, Laurent.
>=20
>=20
>=20

Hi Laurent,

Thank you!

This makes it clear in my mind what is happening.
      $ p6 'dd <a b c d>;'
      ("a", "b", "c", "d")

[] need to be given a "list" of things.  And
      $ p6 'dd "a b c d";'
      "a b c d"
a string is not a list.  The give away is the () that dd
produces.

-T
0
ToddAndMargo
10/5/2018 8:12:50 AM

On 10/5/18 1:12 AM, Todd Chester wrote:
>>> Le ven. 5 oct. 2018 =C3=A0 08:30, Todd Chester <ToddAndMargo@zoho.com=
=20
>>> <mailto:ToddAndMargo@zoho.com>> a =C3=A9crit :
>>>
>>> =C2=A0=C2=A0=C2=A0 Hi All,
>>>
>>> =C2=A0=C2=A0=C2=A0 I went to reply to someone, I think it was Brandon f=
or sending me
>>> =C2=A0=C2=A0=C2=A0 an eMail to my private address and the stinker disap=
peared!
>>>
>>> =C2=A0=C2=A0=C2=A0 Anyway whoever sent me
>>>
>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $ p6 'say <the q=
uick brown>[0,2];'
>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (the brown)
>>>
>>> =C2=A0=C2=A0=C2=A0 I was trying to figure out why this bombed:
>>>
>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $ p6 ' say "a b =
c d"[3,1];'
>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Index out of ran=
ge. Is: 3, should be in 0..0
>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 in block <unit> =
at -e line 1
>>>
>>> =C2=A0=C2=A0=C2=A0 And you beat me to the punch!=C2=A0 It was the <>.
>>>
>>> =C2=A0=C2=A0=C2=A0 Thank you!
>>>
>>> =C2=A0=C2=A0=C2=A0 -T
>>>
>=20
>=20
> On 10/5/18 12:31 AM, Laurent Rosenfeld via perl6-users wrote:
>> Yeah, Todd, the angle brackets operator in <the quick brown> produces=20
>> a list of three words which you can access individually with an index,=
=20
>> whereas quotes in=C2=A0 "a b c d" creates a single string. But to come b=
ack=20
>> to the start of a very long thread of discussion over the last days,=20
>> if you want to access individual words of the string, you can of=20
>> course do this:
>> =C2=A0> say "a b c d".words[3,1];
>> (d b)
>>
>> Cheers, Laurent.
>>
>>
>>
>=20
> Hi Laurent,
>=20
> Thank you!
>=20
> This makes it clear in my mind what is happening.
>  =C2=A0=C2=A0=C2=A0=C2=A0 $ p6 'dd <a b c d>;'
>  =C2=A0=C2=A0=C2=A0=C2=A0 ("a", "b", "c", "d")
>=20
> [] need to be given a "list" of things.=C2=A0 And
>  =C2=A0=C2=A0=C2=A0=C2=A0 $ p6 'dd "a b c d";'
>  =C2=A0=C2=A0=C2=A0=C2=A0 "a b c d"
> a string is not a list.=C2=A0 The give away is the () that dd
> produces.
>=20
> -T


$ p6 ' say <"ab" "cd" "ef">[3,1];'
(Nil "cd")


:-)
0
ToddAndMargo
10/5/2018 8:15:41 AM
--000000000000df5bcf0577775407
Content-Type: text/plain; charset="UTF-8"

That was me. Sending off list was a mistake. And you're welcome. :)

--
raiph


On Fri, Oct 5, 2018 at 7:30 AM Todd Chester <ToddAndMargo@zoho.com> wrote:

> Hi All,
>
> I went to reply to someone, I think it was Brandon for sending me
> an eMail to my private address and the stinker disappeared!
>
> Anyway whoever sent me
>
>      $ p6 'say <the quick brown>[0,2];'
>      (the brown)
>
> I was trying to figure out why this bombed:
>
>      $ p6 ' say "a b c d"[3,1];'
>      Index out of range. Is: 3, should be in 0..0
>      in block <unit> at -e line 1
>
> And you beat me to the punch!  It was the <>.
>
> Thank you!
>
> -T
>

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

<div dir=3D"ltr"><div>That was me. Sending off list was a mistake. And you&=
#39;re welcome. :)</div><div><br></div><div>--</div><div>raiph<br></div><br=
></div><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Fri, Oct 5, 2018 =
at 7:30 AM Todd Chester &lt;<a href=3D"mailto:ToddAndMargo@zoho.com">ToddAn=
dMargo@zoho.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi A=
ll,<br>
<br>
I went to reply to someone, I think it was Brandon for sending me<br>
an eMail to my private address and the stinker disappeared!<br>
<br>
Anyway whoever sent me<br>
<br>
=C2=A0 =C2=A0 =C2=A0$ p6 &#39;say &lt;the quick brown&gt;[0,2];&#39;<br>
=C2=A0 =C2=A0 =C2=A0(the brown)<br>
<br>
I was trying to figure out why this bombed:<br>
<br>
=C2=A0 =C2=A0 =C2=A0$ p6 &#39; say &quot;a b c d&quot;[3,1];&#39;<br>
=C2=A0 =C2=A0 =C2=A0Index out of range. Is: 3, should be in 0..0<br>
=C2=A0 =C2=A0 =C2=A0in block &lt;unit&gt; at -e line 1<br>
<br>
And you beat me to the punch!=C2=A0 It was the &lt;&gt;.<br>
<br>
Thank you!<br>
<br>
-T<br>
</blockquote></div>

--000000000000df5bcf0577775407--
0
ralphdjmellor
10/5/2018 8:47:59 AM
--000000000000f32e62057779e501
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

You don't even need the quotes:

> say <ab cd ef>[3,1];
(Nil cd)
>



Le ven. 5 oct. 2018 =C3=A0 10:15, Todd Chester <ToddAndMargo@zoho.com> a =
=C3=A9crit :

>
>
> On 10/5/18 1:12 AM, Todd Chester wrote:
> >>> Le ven. 5 oct. 2018 =C3=A0 08:30, Todd Chester <ToddAndMargo@zoho.com
> >>> <mailto:ToddAndMargo@zoho.com>> a =C3=A9crit :
> >>>
> >>>     Hi All,
> >>>
> >>>     I went to reply to someone, I think it was Brandon for sending me
> >>>     an eMail to my private address and the stinker disappeared!
> >>>
> >>>     Anyway whoever sent me
> >>>
> >>>           $ p6 'say <the quick brown>[0,2];'
> >>>           (the brown)
> >>>
> >>>     I was trying to figure out why this bombed:
> >>>
> >>>           $ p6 ' say "a b c d"[3,1];'
> >>>           Index out of range. Is: 3, should be in 0..0
> >>>           in block <unit> at -e line 1
> >>>
> >>>     And you beat me to the punch!  It was the <>.
> >>>
> >>>     Thank you!
> >>>
> >>>     -T
> >>>
> >
> >
> > On 10/5/18 12:31 AM, Laurent Rosenfeld via perl6-users wrote:
> >> Yeah, Todd, the angle brackets operator in <the quick brown> produces
> >> a list of three words which you can access individually with an index,
> >> whereas quotes in  "a b c d" creates a single string. But to come back
> >> to the start of a very long thread of discussion over the last days,
> >> if you want to access individual words of the string, you can of
> >> course do this:
> >>  > say "a b c d".words[3,1];
> >> (d b)
> >>
> >> Cheers, Laurent.
> >>
> >>
> >>
> >
> > Hi Laurent,
> >
> > Thank you!
> >
> > This makes it clear in my mind what is happening.
> >       $ p6 'dd <a b c d>;'
> >       ("a", "b", "c", "d")
> >
> > [] need to be given a "list" of things.  And
> >       $ p6 'dd "a b c d";'
> >       "a b c d"
> > a string is not a list.  The give away is the () that dd
> > produces.
> >
> > -T
>
>
> $ p6 ' say <"ab" "cd" "ef">[3,1];'
> (Nil "cd")
>
>
> :-)
>

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

<div dir=3D"ltr"><div dir=3D"ltr"><div>You don&#39;t even need the quotes:<=
/div><div><br></div><div>&gt; say &lt;ab cd ef&gt;[3,1];<br>(Nil cd)<br>&gt=
;</div><div><br></div><div><br></div></div></div><br><div class=3D"gmail_qu=
ote"><div dir=3D"ltr">Le=C2=A0ven. 5 oct. 2018 =C3=A0=C2=A010:15, Todd Ches=
ter &lt;<a href=3D"mailto:ToddAndMargo@zoho.com">ToddAndMargo@zoho.com</a>&=
gt; a =C3=A9crit=C2=A0:<br></div><blockquote class=3D"gmail_quote" style=3D=
"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On 10/5/18 1:12 AM, Todd Chester wrote:<br>
&gt;&gt;&gt; Le ven. 5 oct. 2018 =C3=A0 08:30, Todd Chester &lt;<a href=3D"=
mailto:ToddAndMargo@zoho.com" target=3D"_blank">ToddAndMargo@zoho.com</a> <=
br>
&gt;&gt;&gt; &lt;mailto:<a href=3D"mailto:ToddAndMargo@zoho.com" target=3D"=
_blank">ToddAndMargo@zoho.com</a>&gt;&gt; a =C3=A9crit :<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; =C2=A0=C2=A0=C2=A0 Hi All,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; =C2=A0=C2=A0=C2=A0 I went to reply to someone, I think it was =
Brandon for sending me<br>
&gt;&gt;&gt; =C2=A0=C2=A0=C2=A0 an eMail to my private address and the stin=
ker disappeared!<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; =C2=A0=C2=A0=C2=A0 Anyway whoever sent me<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $ p6 &#=
39;say &lt;the quick brown&gt;[0,2];&#39;<br>
&gt;&gt;&gt; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (the br=
own)<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; =C2=A0=C2=A0=C2=A0 I was trying to figure out why this bombed:=
<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 $ p6 &#=
39; say &quot;a b c d&quot;[3,1];&#39;<br>
&gt;&gt;&gt; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Index o=
ut of range. Is: 3, should be in 0..0<br>
&gt;&gt;&gt; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 in bloc=
k &lt;unit&gt; at -e line 1<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; =C2=A0=C2=A0=C2=A0 And you beat me to the punch!=C2=A0 It was =
the &lt;&gt;.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; =C2=A0=C2=A0=C2=A0 Thank you!<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; =C2=A0=C2=A0=C2=A0 -T<br>
&gt;&gt;&gt;<br>
&gt; <br>
&gt; <br>
&gt; On 10/5/18 12:31 AM, Laurent Rosenfeld via perl6-users wrote:<br>
&gt;&gt; Yeah, Todd, the angle brackets operator in &lt;the quick brown&gt;=
 produces <br>
&gt;&gt; a list of three words which you can access individually with an in=
dex, <br>
&gt;&gt; whereas quotes in=C2=A0 &quot;a b c d&quot; creates a single strin=
g. But to come back <br>
&gt;&gt; to the start of a very long thread of discussion over the last day=
s, <br>
&gt;&gt; if you want to access individual words of the string, you can of <=
br>
&gt;&gt; course do this:<br>
&gt;&gt; =C2=A0&gt; say &quot;a b c d&quot;.words[3,1];<br>
&gt;&gt; (d b)<br>
&gt;&gt;<br>
&gt;&gt; Cheers, Laurent.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt; <br>
&gt; Hi Laurent,<br>
&gt; <br>
&gt; Thank you!<br>
&gt; <br>
&gt; This makes it clear in my mind what is happening.<br>
&gt;=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 $ p6 &#39;dd &lt;a b c d&gt;;&#39;<br>
&gt;=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 (&quot;a&quot;, &quot;b&quot;, &quot;c&=
quot;, &quot;d&quot;)<br>
&gt; <br>
&gt; [] need to be given a &quot;list&quot; of things.=C2=A0 And<br>
&gt;=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 $ p6 &#39;dd &quot;a b c d&quot;;&#39;<=
br>
&gt;=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 &quot;a b c d&quot;<br>
&gt; a string is not a list.=C2=A0 The give away is the () that dd<br>
&gt; produces.<br>
&gt; <br>
&gt; -T<br>
<br>
<br>
$ p6 &#39; say &lt;&quot;ab&quot; &quot;cd&quot; &quot;ef&quot;&gt;[3,1];&#=
39;<br>
(Nil &quot;cd&quot;)<br>
<br>
<br>
:-)<br>
</blockquote></div>

--000000000000f32e62057779e501--
0
perl6
10/5/2018 11:51:44 AM

On 10/5/18 4:51 AM, Laurent Rosenfeld via perl6-users wrote:
> You don't even need the quotes:
> 
>  > say <ab cd ef>[3,1];
> (Nil cd)
>  >

Hi Laurent,

A thing of beauty!

Not to ask to stupid a question (when has that ever
stooped me), but since [] is considered a subroutine,
is <> also considered a subroutine too? If so, what
is it called?

-T
0
ToddAndMargo
10/5/2018 11:59:45 AM
<> is part of the quoting sub-language

It is short for

    q:w' a b c d '

which is short for

    q:words' a b c d '

Note that you can add spaces

    q :words ' a b c d '

Even this is short.
I'm going to show you various ways of writing the exact same thing

    q :w(1) ' a b c d '
    q :w(True) ' a b c d '
    Q :q :w ' a b c d '
    Q :single :words ' a b c d '
    Q :single(True) :words(True) ' a b c d '

Note that :Identifier is short for :Identifier(True)

To learn more about the quoting sub-language read:

https://docs.perl6.org/language/quoting
On Fri, Oct 5, 2018 at 7:00 AM Todd Chester <ToddAndMargo@zoho.com> wrote:
>
>
>
> On 10/5/18 4:51 AM, Laurent Rosenfeld via perl6-users wrote:
> > You don't even need the quotes:
> >
> >  > say <ab cd ef>[3,1];
> > (Nil cd)
> >  >
>
> Hi Laurent,
>
> A thing of beauty!
>
> Not to ask to stupid a question (when has that ever
> stooped me), but since [] is considered a subroutine,
> is <> also considered a subroutine too? If so, what
> is it called?
>
> -T
0
b2gills
10/5/2018 12:24:18 PM
On 10/5/18 5:24 AM, Brad Gilbert wrote:
> <> is part of the quoting sub-language

Hi Brad,

Thank you!

I copied it into my keeper file on <>

-T
0
perl6
10/5/2018 9:27:19 PM
Reply: