Argh.  Indeed, you can't.

  say int32.^name;  # int32

You can only find out the name of the type, *not* when you used that type to 
create a variable.  Because that is just a value in memory *without* a specific 
type.  To be able to call a method on it, it needs to be ugraded to its object 
equivalent, which is Int in the case of int32 (and all other native int types, 
even the unsigned ones).

So I think the answer is: you can't with any native values.

Sorry for the noise.

> On 9 Jan 2020, at 16:15, ToddAndMargo via perl6-users <perl6-us...@perl.org> 
> wrote:
> 
> 
>> On 9 Jan 2020, at 15:50, ToddAndMargo via perl6-users <perl6-us...@perl.org> 
>> wrote:
>>> Any way to get WHAT to tell me specifically that it
>>> is an int32?
>>> 
>>>> my int32 $j=0x45; say $j.WHAT
>>> (Int)
>>> 
>>> 
>>> -T
> 
> On 2020-01-09 07:04, Elizabeth Mattijsen wrote:
> > my int32 $a; say $a.^name;  # int32
> >
> 
> Hi Elizabeth,
> 
> Now what am I doing wrong?
> 
> > my int32 $a; say $a.^name
> Int
> 
> -T

Reply via email to