Re: problems with xor

2020-01-18 Thread ToddAndMargo via perl6-users
On 2020-01-18 13:25, Kevin Pye wrote: As has been explained quite explicitly twice already, you call it as a sub by using the full explicit name of the subroutine: $z = infix:<+^>($x, $y) Hi Kevin, My mistake was thinking "infix" was part of the description of how to write the sub, not acuta

Re: problems with xor

2020-01-18 Thread Kevin Pye
As has been explained quite explicitly twice already, you call it as a sub by using the full explicit name of the subroutine: $z = infix:<+^>($x, $y) On Sun, 19 Jan 2020 at 07:22, ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 2020-01-18 06:09, Tobias Boege wrote: > > On Fri,

Re: problems with xor

2020-01-18 Thread ToddAndMargo via perl6-users
On 2020-01-18 06:09, Tobias Boege wrote: On Fri, 17 Jan 2020, ToddAndMargo via perl6-users wrote: Hi All, https://docs.raku.org/routine/+$CIRCUMFLEX_ACCENT (Operators) infix +^§ multi sub infix:<+^>($a, $b --> Int:D) Integer bitwise XOR operator: Coerces both arguments to Int and does a bitw

Re: problems with xor

2020-01-18 Thread ToddAndMargo via perl6-users
On 2020-01-17 22:26, Darren Duncan wrote: On 2020-01-17 9:00 p.m., ToddAndMargo via perl6-users wrote: Still don't know what they used the word "sub" The term "sub" is short for "subroutine", and declaring routines that way is part of the Perl legacy that lasted into Raku. -- Darren Duncan

Re: problems with xor

2020-01-18 Thread Tobias Boege
On Fri, 17 Jan 2020, ToddAndMargo via perl6-users wrote: > Hi All, > > https://docs.raku.org/routine/+$CIRCUMFLEX_ACCENT > > (Operators) infix +^§ > > multi sub infix:<+^>($a, $b --> Int:D) > > Integer bitwise XOR operator: Coerces both arguments to Int and does a > bitwise XOR (exclusive OR) o

Re: problems with xor

2020-01-17 Thread Darren Duncan
On 2020-01-17 9:00 p.m., ToddAndMargo via perl6-users wrote: Still don't know what they used the word "sub" The term "sub" is short for "subroutine", and declaring routines that way is part of the Perl legacy that lasted into Raku. -- Darren Duncan

Re: problems with xor

2020-01-17 Thread ToddAndMargo via perl6-users
On 2020-01-17 21:43, Paul Procacci wrote: Apocalypse 3: "/operators are just funny/ looking /function/ calls" Chuckle!

Re: problems with xor

2020-01-17 Thread Paul Procacci
Apocalypse 3: "*operators are just funny* looking *function* calls" On Sat, Jan 18, 2020 at 12:31 AM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 2020-01-17 20:49, Kevin Pye wrote: > > In Raku, all operators are just functions with a funny syntax > > I like the way you wrote

Re: problems with xor

2020-01-17 Thread ToddAndMargo via perl6-users
On 2020-01-17 20:49, Kevin Pye wrote: In Raku, all operators are just functions with a funny syntax I like the way you wrote that. Your technical writing just got some fan mail.

Re: problems with xor

2020-01-17 Thread ToddAndMargo via perl6-users
On 2020-01-17 20:49, Kevin Pye wrote: n Raku, all operators are just functions with a funny syntax, but if you want to use it as a function, you need the full name. infix:<+^>($x, $y) would probably work just as well. $z = +^($x, $y) no work so well. $ p6 'my uint8 $x=0b0101_0111; my uint8

Re: problems with xor

2020-01-17 Thread ToddAndMargo via perl6-users
On 2020-01-17 20:43, ToddAndMargo via perl6-users wrote: On Sat, 18 Jan 2020 at 15:03, ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote:     Hi All,     https://docs.raku.org/routine/+$CIRCUMFLEX_ACCENT     (Operators) infix +^§     multi sub infix:<+^>($a, $b --> Int:D)    

Re: problems with xor

2020-01-17 Thread Kevin Pye
In Raku, all operators are just functions with a funny syntax, but if you want to use it as a function, you need the full name. infix:<+^>($x, $y) would probably work just as well. And where is the '$' before the z? On Sat, 18 Jan 2020 at 15:45, ToddAndMargo via perl6-users < perl6-us...@perl.or

Re: problems with xor

2020-01-17 Thread ToddAndMargo via perl6-users
On Fri, Jan 17, 2020 at 11:03 PM ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: Hi All, https://docs.raku.org/routine/+$CIRCUMFLEX_ACCENT (Operators) infix +^§ multi sub infix:<+^>($a, $b --> Int:D) Integer bitwise XOR operator: Coerces both arguments t

Re: problems with xor

2020-01-17 Thread ToddAndMargo via perl6-users
On Sat, 18 Jan 2020 at 15:03, ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: Hi All, https://docs.raku.org/routine/+$CIRCUMFLEX_ACCENT (Operators) infix +^§ multi sub infix:<+^>($a, $b --> Int:D) Integer bitwise XOR operator: Coerces both arguments to I

Re: problems with xor

2020-01-17 Thread Paul Procacci
multi sub infix:<+^>($a, $b --> Int:D) _infix_ here is the keyword for you. my uint8 $z = $x +^ $y; On Fri, Jan 17, 2020 at 11:03 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > Hi All, > > https://docs.raku.org/routine/+$CIRCUMFLEX_ACCENT > > (Operators) infix +^§ > > multi s

Re: problems with xor

2020-01-17 Thread Kevin Pye
As you say, +^ is an infix operator. Why are you trying to use it as a function? Try $z = $x +^ $y. On Sat, 18 Jan 2020 at 15:03, ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > Hi All, > > https://docs.raku.org/routine/+$CIRCUMFLEX_ACCENT > > (Operators) infix +^§ > > multi sub in

problems with xor

2020-01-17 Thread ToddAndMargo via perl6-users
Hi All, https://docs.raku.org/routine/+$CIRCUMFLEX_ACCENT (Operators) infix +^§ multi sub infix:<+^>($a, $b --> Int:D) Integer bitwise XOR operator: Coerces both arguments to Int and does a bitwise XOR (exclusive OR) operation. $ p6 'my uint8 $x=0b0101_0111; my uint8 $y = 0b_; my u