Created
September 27, 2016 16:37
-
-
Save zoffixznet/82e9c75b2230c351c8857611f03590d9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use nqp; | |
sub dd(|) { | |
my $args := nqp::p6argvmarray(); | |
if nqp::elems($args) { | |
while $args { | |
my $var := nqp::shift($args); | |
my $varname := try $var.VAR.?name; | |
my $vartype := $var.VAR.of.^name; | |
my $val := $var.?is-lazy | |
?? $var[^10].perl.chop ~ "... (lazy list)" | |
!! $var.perl; | |
my $valtype = $var.^name; | |
note ($varname and "$vartype $varname = "), $val, " ($valtype)"; | |
} | |
} | |
else { # tell where we are | |
note .name ?? "{lc .^name} {.name}" !! "({lc .^name})" | |
with callframe(1).code; | |
} | |
return | |
} | |
my Numeric $x = 41; my Numeric $y = 42; my Numeric $z = 43; my Numeric $w = 44; dd [ $x, $y, $z, $w ]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment