Re: trouble returning a value from sub

2022-06-18 Thread ToddAndMargo via perl6-users
On 6/16/22 10:10, Rick Bychowski wrote: sub MAIN($n = 20) {    .say for factors($n); # Nil } I thought `MAIN` was a reserved variable. Am I missing something?

append to Bug question

2022-06-18 Thread ToddAndMargo via perl6-users
Hi All, What am I doing wrong here: > my Buf $y = Buf.new( 0xFA xx 10); Buf:0x > $y ~= 0xBB.encode.Buf; Buf:0x I got three entries (31 38 37) instead of one (0xBB) Some more goofing around: > $y ~= 0xBB; Stringification of a Buf is not done with 'Str'. The 'decode' method should be used to

Re: append to Bug question

2022-06-18 Thread ToddAndMargo via perl6-users
What am I doing wrong here too? my $d = buf8.new( 0xDE..0xDB ); Buf[uint8]:0x<> -- ~~ Computers are like air conditioners. They malfunction when you open windows ~~

Re: trouble returning a value from sub

2022-06-18 Thread Bruce Gray
> On Jun 18, 2022, at 10:42 PM, ToddAndMargo via perl6-users > wrote: > > On 6/16/22 10:10, Rick Bychowski wrote: >> sub MAIN($n = 20) { >>.say for factors($n); # Nil >> } > > > I thought `MAIN` was a reserved variable. Am > I missing something? MAIN has a special meaning as a sub nam

Re: append to Bug question

2022-06-18 Thread ToddAndMargo via perl6-users
On 6/18/22 22:12, ToddAndMargo via perl6-users wrote: What am I doing wrong here too? my $d = buf8.new( 0xDE..0xDB ); Buf[uint8]:0x<> Not sure why the above did not work, but this does: Presalt with swept entries: > my buf8 $e = buf8.new(0x5..0x8); Buf[uint8]:0x<05 06 07 08> > my b

Re: append to Bug question

2022-06-18 Thread ToddAndMargo via perl6-users
On 6/18/22 21:13, ToddAndMargo via perl6-users wrote: Hi All, What am I doing wrong here: > my Buf $y = Buf.new( 0xFA xx 10); Buf:0x > $y ~= 0xBB.encode.Buf; Buf:0x I got three entries (31 38 37) instead of one (0xBB) Some more goofing around: > $y ~= 0xBB; Stringification of a Buf is n

Re: append to Bug question

2022-06-18 Thread Bruce Gray
> On Jun 18, 2022, at 11:13 PM, ToddAndMargo via perl6-users > wrote: > > Hi All, > > What am I doing wrong here: From just looking at your code, I am not clear on what you are trying to do. > > my Buf $y = Buf.new( 0xFA xx 10); > Buf:0x > > > $y ~= 0xBB.encode.Buf; > Buf:0x > > I got th

Re: append to Bug question

2022-06-18 Thread ToddAndMargo via perl6-users
On 6/18/22 22:58, Bruce Gray wrote: From just looking at your code, I am not clear on what you are trying to do. I am updating my Keeper on buffers. I have four of them that are a mess and I an going to consolidate them into a single .ODT (open document text) file with an index.

Re: append to Bug question

2022-06-18 Thread ToddAndMargo via perl6-users
On 6/18/22 22:58, Bruce Gray wrote: If all you want is to append 0xBB to $y, either of these will work: $y ~= Buf.new(0xBB); $y.append(0xBB); Did not realize I could use buf new like that. Thank you! Append numbers to a buffer: > $x Buf:0x<41 42 43 44> > $x.append( 0xDD ); Buf:0

Re: trouble returning a value from sub

2022-06-18 Thread ToddAndMargo via perl6-users
On 6/18/22 22:16, Bruce Gray wrote: On Jun 18, 2022, at 10:42 PM, ToddAndMargo via perl6-users wrote: On 6/16/22 10:10, Rick Bychowski wrote: sub MAIN($n = 20) { .say for factors($n); # Nil } I thought `MAIN` was a reserved variable. Am I missing something? MAIN has a special mea