Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

40 lines (34 sloc) 0.631 kb
use v6;
use Test;
plan 4;
# L<S17/Atomic Code blocks>
my ($x, $y);
sub c {
$x -= 3; $y += 3;
$x < 10 or defer;
}
sub d {
$x += 3; $y -= 3;
$y < 10 or defer;
}
#?pugs todo 'unimpl'
ok eval( q{
contend {
# ...
maybe { c() } maybe { d() };
# ...
} } )
,'contend/maybe/defer construct';
# L<S17/Atomic Code blocks/maybe>
#?pugs todo 'unimpl'
ok eval( q{
maybe { c() };
} ),'method <maybe> known';
# L<S17/Atomic Code blocks/defer>
ok c(),'method <defer> known';
# L<S17/Atomic Code blocks/contend>
sub e {
my $x; return ++$x;
}
ok contend { e(); },'method <contend> known';
# vim: ft=perl6
Jump to Line
Something went wrong with that request. Please try again.