On 10/2/18 10:16 PM, David Green wrote:
On 2018-10-02 9:57 pm, ToddAndMargo wrote:
Does anyone know of a paper out in web land showing how to do bitwise
operations?
Trying to AND 0010 0000 with 0001 0000
$ p6 'my $v = 32 & 16; say $v;'
If you search docs.perl6.org for "bitwise" you will find "+&":
https://docs.perl6.org/language/operators#infix_+&
And sure enough, 'say 32 +& 16' will return '0'.
The other bitwise operators work likewise: almost the same as Perl 5,
but with a "+" in front (to indicate that they are numeric operators, as
opposed to plain "&", "|", etc., which are now junctions... and yes,
there is https://docs.perl6.org/type/Junction for those who dare!).
-David
P.S. Actually, the search returns:
https://docs.perl6.org/language/operators#index-entry-Numeric_bitwise_AND_operator
...instead of the correct fragment: "#infix_+&" -- is that generated
automatically?
Thank you.
Looks like I am going to have to look them up one at a time.
The paper I had from Perl 5 had hem in a table. AND, OR, NOR,
NAND, XOR, IN, shift left, shift right, etc..
-T