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

Re: pointer confusion

Thread Previous | Thread Next
Ralph Mellor
December 5, 2022 17:26
Re: pointer confusion
Message ID:
On Sat, Dec 3, 2022 at 11:44 AM ToddAndMargo via perl6-users
<> 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?


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About