Guest User

Untitled

a guest
Aug 16th, 2019
418
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 6 0.28 KB | None | 0 0
  1. my $channel = Channel.new();
  2. sub a {
  3.     b();
  4.     gather {
  5.     loop {
  6.         take $channel.poll() // do {
  7.             b();
  8.             $channel.receive();
  9.         }
  10.     }
  11.     }
  12. }
  13.  
  14. sub b() {
  15.     $channel.send(3);
  16.     $channel.send(4);
  17. }
  18.  
  19. for a() -> $a {
  20.     say $a;
  21. }
  22. ~
Advertisement
Add Comment
Please, Sign In to add comment