On 09/16/2018 05:52 PM, ToddAndMargo wrote:
Hi All,

I am confused, again:


$ p6 'my $x=3; dd $x'
Int $x = 3
Makes sense


$ p6 'my $x; dd $x'
Any $x = Any
Makes Sense

$ p6 'my Real $x; dd $x'
Real $x = Real
makes sense

$ p6 'my Real $x = 3; dd $x'
Int $x = 3
What ???? Integer ?????  Did I or did I not just tell it
is was a "Real" ?????

:'(

-T


The plot thickens:

$ p6 'my Real $x; $x = "abc"; dd $x'
Type check failed in assignment to $x; expected Real but got Str ("abc")
  in block <unit> at -e line 1

This is what I expected


$ p6 'my Real $x; $x = 3; dd $x; say $x.perl'
Int $x = 3
3

Not what I expected


$ p6 'my Real $x; $x = 3.1415; dd $x; say $x.perl'
Rat $x = 3.1415
3.1415

Huh?  Now is it a "Rational number".


AAAAAAAAAA HHHHHHHHHHHHH !!!!!!

Reply via email to