Re: shift left syntax?

2019-02-08 Thread ToddAndMargo via perl6-users
>> >> Hi All, >> >> Is this the only way to shift left? >> >> $i = $i +< 0x01 >> >> $ p6 'my int32 $i=0x5DAE; say $i.base(0x10); $i = $i +< 0x01; say >> $i.base(0x10);' >> >> 5DAE >> BB5C >> >> >> Does we have any of those fancy += ~= ways of doing it? >> >> Many thanks, >> -T On

Re: shift left syntax?

2019-02-08 Thread Brad Gilbert
The `=` infix operator is a meta operator. That means it takes an infix operator as a sort of "argument". There is no `+=` operator, it is just the `=` operator combined with the `+` operator. $a += 2; $a [+]= 2; # more explicitly take the + operator as an argument to the = operator So

Re: shift left syntax?

2019-02-07 Thread Todd Chester via perl6-users
On 2/7/19 10:36 PM, yary wrote: perl6 -e 'my $i = 0x5DAE; $i +<= 1; say $i.base(0x10);' BB5C -y Hi Yary, $ p6 'my Buf $x=Buf.new(0xAE,0x5D); my int32 $i=0x5DAE; say $x; say $i.base(0x10); $i +< 0x01; say $i.base(0x10);' WARNINGS for -e: Useless use of "+<" in expression "$i

Re: shift left syntax?

2019-02-07 Thread yary
perl6 -e 'my $i = 0x5DAE; $i +<= 1; say $i.base(0x10);' BB5C -y >

shift left syntax?

2019-02-07 Thread Todd Chester via perl6-users
Hi All, Is this the only way to shift left? $i = $i +< 0x01 $ p6 'my int32 $i=0x5DAE; say $i.base(0x10); $i = $i +< 0x01; say $i.base(0x10);' 5DAE BB5C Does we have any of those fancy += ~= ways of doing it? Many thanks, -T