Created
September 27, 2016 16:46
-
-
Save zoffixznet/9b02fb4fef88137a5523afc910aa7b96 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 ddd(|) { | |
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; | |
my %hash{Any} = | |
foo => [ $x, $y, $z, $w ], | |
bar => [ $x, $y, $z, $w ], | |
; | |
{ print "OLD: "; dd $_; print "NEW: "; ddd $_ }() given %hash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment