On Tue, 7 Aug 2018, 08:16 ToddAndMargo, <toddandma...@zoho.com
<mailto:toddandma...@zoho.com>> wrote:
Hi All,
I am confused.
This line will convert a string into an integer, but
will print out and extra line with "(Int)" on it:
$ p6 'my Str $x = "5"; my Int $y = dd +$x; say $y'
5
(Int)
This will convert as well, but no extra line:
$ p6 'my Int $x; my Str $y = "5"; $x = "$y" + 0; say $x'
5
Also, I can quote $x, and it still works:
$ p6 'my Int $x; my Str $y = "5"; $x = "$y" + 0; say "$x"'
5
But this tells me I have an uninitialized value, when all
I did was add quotes around $y, as in the above line.
$ p6 'my Str $x = "5"; my Int $y = dd +$x; say "$y";'
5
Use of uninitialized value $y of type Int in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify
it to something meaningful.
Why would I want to use "dd"?
Many thanks,
-T
On 08/07/2018 12:19 AM, Simon Proctor wrote:
dd is the moarvm specific data dump command. You don't need it.
--
Simon Proctor
Cognoscite aliquid novum cotidie
Thank you!
What is "moarvm"