Re: printf question

2020-02-03 Thread ToddAndMargo via perl6-users
On Mon, Feb 3, 2020 at 8:17 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: On 2020-02-03 13:51, ToddAndMargo via perl6-users wrote: > p6 'my uint8 $u = 84; printf "\$u = <%08s>\n", $u;' Oops, that should have been $ p6 'my uint8 $u = 0x4F; printf "\$u =

Re: printf question

2020-02-03 Thread Paul Procacci
Here's one way my uint8 $u = 0x4F; say '$u = <0b' ~ '%08b'.sprintf($u).comb(/\d ** 4/).join('_') ~ '>;'; There's probably others as well. On Mon, Feb 3, 2020 at 8:17 PM ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: > On 2020-02-03 13:51, ToddAndMargo via perl6-users wrote: >

Re: printf question

2020-02-03 Thread ToddAndMargo via perl6-users
On 2020-02-03 13:51, ToddAndMargo via perl6-users wrote: p6 'my uint8 $u = 84; printf "\$u = <%08s>\n", $u;' Oops, that should have been $ p6 'my uint8 $u = 0x4F; printf "\$u = <%#b>\n", $u;' $u = <0b100> Who do I get it to print 0b0100_ ? -T

Re: bytes are used in an UInt/Int?

2020-02-03 Thread ToddAndMargo via perl6-users
On 2020-02-03 16:35, Tobias Boege wrote: On Mon, 03 Feb 2020, ToddAndMargo via perl6-users wrote: Hi All, Did Larry put a sneaky way to tell how many bytes a UInt/Int is using? The number of bits required to store an Int is, for positive numbers, the same as the index of their most

Re: bytes are used in an UInt/Int?

2020-02-03 Thread Tobias Boege
On Mon, 03 Feb 2020, ToddAndMargo via perl6-users wrote: > Hi All, > > Did Larry put a sneaky way to tell how many bytes > a UInt/Int is using? > The number of bits required to store an Int is, for positive numbers, the same as the index of their most significant bit, which is available via

bytes are used in an UInt/Int?

2020-02-03 Thread ToddAndMargo via perl6-users
Hi All, Did Larry put a sneaky way to tell how many bytes a UInt/Int is using? Many thanks, -T

Re: stolen uint's

2020-02-03 Thread ToddAndMargo via perl6-users
On 2020-01-30 17:20, Veesh Goldman wrote: Hi Todd, A couple of things. One is that Int and int are totally unrelated concepts. Captial Int is a high level concept, which has a type constraint related to it, and belongs to raku's object system. Lowercase int is a special case, it's only for

Re: printf question

2020-02-03 Thread ToddAndMargo via perl6-users
On Mon, Feb 3, 2020 at 3:52 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: Hi All, Is ther a way to get $ p6 'my uint8 $u = 84; printf "\$u = <%08s>\n", $u;' $u = <0084> to print $u = <_0084> ? Many thanks, -T On

Re: printf question

2020-02-03 Thread yary
I think you need a more specific question... p6 'my uint8 $u = 84; printf "\$u = <_%04s>\n", $u;' -y On Mon, Feb 3, 2020 at 3:52 PM ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: > Hi All, > > Is ther a way to get > > $ p6 'my uint8 $u = 84; printf "\$u = <%08s>\n", $u;' > $u

printf question

2020-02-03 Thread ToddAndMargo via perl6-users
Hi All, Is ther a way to get $ p6 'my uint8 $u = 84; printf "\$u = <%08s>\n", $u;' $u = <0084> to print $u = <_0084> ? Many thanks, -T

Re: perl6 with XS

2020-02-03 Thread ToddAndMargo via perl6-users
> On Mon, Feb 3, 2020 at 12:41 AM Darren Duncan > wrote: > > Raku has the Native Call interface > https://docs.raku.org/language/nativecall > which is what you use instead. -- Darren Duncan > > On 2020-02-02 6:36 p.m., wes park wrote: > > HI >

Re: perl6 with XS

2020-02-03 Thread Wyatt Chun
Can perl6 manage C Pointer directly? that would be amazing really. regards. On Mon, Feb 3, 2020 at 7:35 PM Aureliano Guedes wrote: > Also, this is amazing: > https://docs.raku.org/language/nativecall#sub_nativecast > > > > On Mon, Feb 3, 2020 at 8:32 AM Aureliano Guedes < >

Re: perl6 with XS

2020-02-03 Thread Aureliano Guedes
Also, this is amazing: https://docs.raku.org/language/nativecall#sub_nativecast On Mon, Feb 3, 2020 at 8:32 AM Aureliano Guedes wrote: > This is nice. > Sorry for my ignorance but what is the advantage in use CArray instead of > a usual raku array? >

Re: perl6 with XS

2020-02-03 Thread Aureliano Guedes
This is nice. Sorry for my ignorance but what is the advantage in use CArray instead of a usual raku array? https://docs.raku.org/language/nativecall#CArray_methods On Mon, Feb 3, 2020 at 12:41 AM Darren Duncan wrote: > Raku has the Native Call interface >