develooper Front page | perl.perl6.users | Postings from January 2020

Re: stolen uint's

Thread Previous | Thread Next
From:
ToddAndMargo via perl6-users
Date:
January 30, 2020 19:56
Subject:
Re: stolen uint's
Message ID:
fbde1718-2550-6ca4-0499-b49c91acb5d2@zoho.com
On 2020-01-30 08:11, Andy Bach wrote:
>>> I’m STILL waiting  for you to show me ONE example of a `uint` turning
>>> into `int`.  Not `Int`, via auto-boxing, `int`, via who-knows-what.
> 
> $ p6 'my uint8 $u; say $u.^name;'
> Int
> 
> Did you not notice the capital "I" in both his request and your code output?

Hi Andy,


Oh I did.  It was just a bad example.

And as far as the Int thing goes, to figure that out,
the structure of the variable had to be queried,
so there is a trail back to the actual type of
of variable.  In other words, it should have
given the correct answer as to what the variable
was declared as.  So no excuses.

Raku variables all come with structures, so
no excuses for ^name saying a banana is a rabbit.
The structure is were ^name queried to get
the Int.

My opinion, ^name should be dropped if it is
not going to give back the actually type of the
variable.

I posted a better example showing where a
declared uint8 was being treated as a int8:
suddenly, 0xFF became -1.

-T

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