Guest User

Untitled

a guest
Aug 15th, 2017
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. ## testing '==>>' feed operator
  2.  
  3. my @x = 1..5; my @y; my @z;
  4.  
  5. say @x; # [1 2 3 4 5]
  6.  
  7. @x ==> map {$_ * 2} ==> @y;
  8. say @y; # [2 4 6 8 10]
  9.  
  10. @x ==>> @y
  11. ==> @z;
  12. ## ERROR: "'==>>' feed operator not yet implemented. Sorry."
  13. ## Output should be [1 2 3 4 5 2 4 6 8 10], according to
  14. ## en.wikibooks.org/wiki/Perl_6_Programming/Lazy_Lists_and_Feeds#Feeds
Advertisement
Add Comment
Please, Sign In to add comment