develooper Front page | perl.perl6.users | Postings from December 2022

Re: pointer confusion

Thread Previous | Thread Next
From:
ToddAndMargo via perl6-users
Date:
December 5, 2022 22:20
Subject:
Re: pointer confusion
Message ID:
f898dcb6-0405-f6f0-7cb6-c0412934ef52@zoho.com
On 12/5/22 09:25, Ralph Mellor wrote:
> On Sat, Dec 3, 2022 at 11:44 AM ToddAndMargo via perl6-users
> <perl6-users@perl.org> wrote:
>>
>> I am confused
> 
> I think the following is a golf of your confusion:
> ```
> use NativeCall;
> my Pointer $foo .= new: 42;
> say $foo;   # NativeCall::Types::Pointer<0x2a>
> print $foo; # NativeCall::Types::Pointer<5895604297984>
> ```
> I can see how someone might be confused by the two numbers:
> 
> * Decimal `42` which is the same as hex `0x2a`.
> 
> * Decimal `5895604297984` (or whatever) which isn't `42`/`0x2a`.
> 
> Why isn't the third number the same as the first two?
> 
> Am I right in thinking this distills what is confusing to you?
> 
> --
> raiph
Yes

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About