[perl #124983]

--089e0826f8309af752055f68d3e6
Content-Type: text/plain; charset="UTF-8"

1. now it's moved to S06-operator-overloading/infix.t

2. note that default Left-associative works, this ticket in fact about
reserved words. See the example below:

```
{
  my sub infix:<Z> ($a, $b) {
      $a ** $b;
  }
  is (2 Z 1 Z 2), 4, "default Left-associative works.";
}
# Calling infix:<Z>(Int, Int, Int) will never work with declared signature
($a, $b)
```

```
{
  my sub infix:<B> ($a, $b) {
      $a ** $b;
  }
  is (2 B 1 B 2), 4, "default Left-associative works.";
}
# ok
```

```
{
  my sub infix:<.> ($a, $b) {
      $a ** $b;
  }
  is (2 . 1 . 2), 4, "default Left-associative works.";
}
# Unsupported use of . to concatenate strings; in Perl 6 please use ~
```

```
{
  my sub infix:<~> ($a, $b) {
      $a ** $b;
  }
  is (2 ~ 1 ~ 2), 4, "default Left-associative works.";
}
# ok
```

```
{
  my sub infix:<@> ($a, $b) {
      $a ** $b;
  }
  is (2 @ 1 @2), 4, "default Left-associative works.";
}
# ok
```

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

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:monospac=
e,monospace;font-size:large">1. now it&#39;s moved to S06-operator-overload=
ing/infix.t</div><div class=3D"gmail_default" style=3D"font-family:monospac=
e,monospace;font-size:large"><br></div><div class=3D"gmail_default" style=
=3D"font-family:monospace,monospace;font-size:large">2. note that default=
=C2=A0Left-associative works, this ticket in fact about reserved words. See=
 the example below:</div><div class=3D"gmail_default" style=3D"font-family:=
monospace,monospace;font-size:large"><br></div><div class=3D"gmail_default"=
 style=3D"font-family:monospace,monospace;font-size:large">```</div><div cl=
ass=3D"gmail_default" style=3D"font-family:monospace,monospace;font-size:la=
rge"><div class=3D"gmail_default">{</div><div class=3D"gmail_default">=C2=
=A0 my sub infix:&lt;Z&gt; ($a, $b) {</div><div class=3D"gmail_default">=C2=
=A0 =C2=A0 =C2=A0 $a ** $b;</div><div class=3D"gmail_default">=C2=A0 }</div=
><div class=3D"gmail_default">=C2=A0 is (2 Z 1 Z 2), 4, &quot;default Left-=
associative works.&quot;;</div><div class=3D"gmail_default">}</div><div>#=
=C2=A0<span style=3D"font-variant-ligatures:no-common-ligatures;background-=
color:rgba(0,0,0,0.8);color:rgb(40,254,20);font-family:&quot;Source Code Pr=
o&quot;;font-size:16px">Calling infix:&lt;Z&gt;(Int, Int, Int) will never w=
ork with declared signature ($a, $b)</span></div>







</div><div class=3D"gmail_default" style=3D"font-family:monospace,monospace=
;font-size:large">```</div><div class=3D"gmail_default" style=3D"font-famil=
y:monospace,monospace;font-size:large"><br></div><div class=3D"gmail_defaul=
t" style=3D"font-family:monospace,monospace;font-size:large">```</div><div =
class=3D"gmail_default" style=3D"font-family:monospace,monospace;font-size:=
large"><div class=3D"gmail_default">{</div><div class=3D"gmail_default">=C2=
=A0 my sub infix:&lt;B&gt; ($a, $b) {</div><div class=3D"gmail_default">=C2=
=A0 =C2=A0 =C2=A0 $a ** $b;</div><div class=3D"gmail_default">=C2=A0 }</div=
><div class=3D"gmail_default">=C2=A0 is (2 B 1 B 2), 4, &quot;default Left-=
associative works.&quot;;</div><div class=3D"gmail_default">}</div><div cla=
ss=3D"gmail_default"># ok</div></div><div class=3D"gmail_default" style=3D"=
font-family:monospace,monospace;font-size:large">```</div><div class=3D"gma=
il_default" style=3D"font-family:monospace,monospace;font-size:large"><br><=
/div><div class=3D"gmail_default" style=3D"font-family:monospace,monospace;=
font-size:large">```</div><div class=3D"gmail_default" style=3D"font-family=
:monospace,monospace;font-size:large"><div class=3D"gmail_default">{</div><=
div class=3D"gmail_default">=C2=A0 my sub infix:&lt;.&gt; ($a, $b) {</div><=
div class=3D"gmail_default">=C2=A0 =C2=A0 =C2=A0 $a ** $b;</div><div class=
=3D"gmail_default">=C2=A0 }</div><div class=3D"gmail_default">=C2=A0 is (2 =
.. 1 . 2), 4, &quot;default Left-associative works.&quot;;</div><div class=
=3D"gmail_default">}</div><div class=3D"gmail_default">#=C2=A0<span style=
=3D"font-variant-ligatures:no-common-ligatures;background-color:rgba(0,0,0,=
0.8);color:rgb(40,254,20);font-family:&quot;Source Code Pro&quot;;font-size=
:16px">Unsupported use of . to concatenate strings; in Perl 6 please use ~<=
/span></div>







</div><div class=3D"gmail_default" style=3D"font-family:monospace,monospace=
;font-size:large">```</div><div class=3D"gmail_default" style=3D"font-famil=
y:monospace,monospace;font-size:large"><br></div><div class=3D"gmail_defaul=
t" style=3D"font-family:monospace,monospace;font-size:large">```</div><div =
class=3D"gmail_default" style=3D"font-family:monospace,monospace;font-size:=
large"><div class=3D"gmail_default">{</div><div class=3D"gmail_default">=C2=
=A0 my sub infix:&lt;~&gt; ($a, $b) {</div><div class=3D"gmail_default">=C2=
=A0 =C2=A0 =C2=A0 $a ** $b;</div><div class=3D"gmail_default">=C2=A0 }</div=
><div class=3D"gmail_default">=C2=A0 is (2 ~ 1 ~ 2), 4, &quot;default Left-=
associative works.&quot;;</div><div class=3D"gmail_default">}</div><div># o=
k</div></div><div class=3D"gmail_default" style=3D"font-family:monospace,mo=
nospace;font-size:large">```</div><div class=3D"gmail_default" style=3D"fon=
t-family:monospace,monospace;font-size:large"><br></div><div class=3D"gmail=
_default" style=3D"font-family:monospace,monospace;font-size:large">```</di=
v><div class=3D"gmail_default" style=3D"font-family:monospace,monospace;fon=
t-size:large"><div class=3D"gmail_default">{</div><div class=3D"gmail_defau=
lt">=C2=A0 my sub infix:&lt;@&gt; ($a, $b) {</div><div class=3D"gmail_defau=
lt">=C2=A0 =C2=A0 =C2=A0 $a ** $b;</div><div class=3D"gmail_default">=C2=A0=
 }</div><div class=3D"gmail_default">=C2=A0 is (2 @ 1 @2), 4, &quot;default=
 Left-associative works.&quot;;</div><div class=3D"gmail_default">}</div><d=
iv># ok</div></div><div class=3D"gmail_default" style=3D"font-family:monosp=
ace,monospace;font-size:large">```</div></div>

--089e0826f8309af752055f68d3e6--
0
wander4096
12/3/2017 5:24:54 AM
perl.perl6.compiler 1196 articles. 0 followers. Follow

0 Replies
0 Views

Similar Articles

[PageSpeed] 58

Reply: