use v6-alpha; use Test; plan 7; unless try({ eval("1", :lang) }) { skip_rest; exit; } { my $r = eval("0", :lang); is($r, 0, "number"); } { my $r = eval("2", :lang); is($r, 2, "number"); } { my $r = eval('"perl6 now"', :lang); is($r, 'perl6 now', "string"); } my $p5_dumper = eval('sub {use Data::Dumper; return @_; }', :lang); my %h = ( a => 1 ); { my $test = '%h.kv received as hash'; my ($k,$v) = $p5_dumper(%h.kv); is($k, 'a', $test~' (key)'); is($v, '1', $test~' (value)'); } { my $test = '\%h received as hashref'; my %o := $p5_dumper(\%h); is(%o, 1, $test); my $ref = $p5_dumper(\%h); is($ref, 1, $test); } # $p5_dumper.(VAR %h); # received as hashref # # my @a = ; # $p5_dumper.(@a); # received as array # $p5_dumper.(\@a); # received as arrayref # $p5_dumper.(VAR @a); # received as arrayref # # my $s = 'str'; # $p5_dumper.($s); # received as scalar # $p5_dumper.(\$s); # received as scalar (inconsistent!) # $p5_dumper.(VAR $s); # received as scalarref