Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 28 lines (19 sloc) 0.471 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
use v6;
use Test;

plan 5;

# L<S06/Pairs as lvalues/>

eval_dies_ok 'my $var; (key => $var) = "value"';

{
    my ($a, $b);
    $b = 'b';
    :(:$a) := $b;
    is $a, 'b', 'can bind to single pair';
    ok $a =:= $b, 'variables are bound together (?)';
}

{
    my ($t, $m);
    :(:type($t), :motivation($m)) := (type => 'geek', motivation => '-Ofun');
    is $t, 'geek', 'bound to the first pair';
    is $m, '-Ofun', 'bound ot the second pair';
}




# vim: ft=perl6
Something went wrong with that request. Please try again.