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 $var = 42;
dd $var